Cod sursa(job #147759)
Utilizator | Data | 3 martie 2008 15:14:53 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.21 kb |
#include<fstream.h>
long a,b,d;
ifstream f("euclid.in");
ofstream g("euclid.out");
int main()
{
long r;
f>>a>>b;
while(b)
{
r=a%b;
a=b;
b=r;
}
g<<a;
f.close();
g.close();
return 0;
}