Cod sursa(job #357745)
Utilizator | Data | 20 octombrie 2009 17:08:24 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
# include <iostream.h>
# include <fstream.h>
using namespace std;
int main()
{
int n,p=1,q=1,c=0;
ifstream f("fractii.in");
ofstream g("fractii.out");
f>>n;
while (p<=n){
if ((p%q!=0) || (q==1)) c++;
p++;q++;
}
g<<c;
f.close();
g.close();
return 0;
}