Cod sursa(job #89323)

Utilizator hatsumomoawd dfs hatsumomo Data 6 octombrie 2007 15:04:11
Problema Fractii Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include <fstream.h>
ifstream fin("fractii.in");
ofstream fout("fractii.out");
main()
{int n,i,j,copyi,copyj,r,nr=0;
fin>>n;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
copyi=i; copyj=j;
while(copyj)
{
r=copyi%copyj;
copyi=copyj;
copyj=r;
}
if(copyi==1) nr++;
}
fout<<nr;
return 0;
}