Cod sursa(job #89322)
Utilizator | Data | 6 octombrie 2007 15:02:42 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
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;
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) fout<<i<<"/"<<j<<'\n';
}
return 0;
}