Cod sursa(job #131014)
Utilizator | Data | 2 februarie 2008 21:20:35 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream.h>
int main()
{
ifstream fin("fractii.in");
ofstream fout("fractii.out");
long n;
long a,b;
long c=0;
fin>>n;
for (a=1;a<=n;a++)
for (b=1;b<=n-1;b++)
if (a%b!=0||b==1)
if (a==1) c++; else if (b%a!=0) c++;
fout<<c;
fin.close();
fout.close();
return 0;
}