Cod sursa(job #143675)
Utilizator | Data | 26 februarie 2008 19:19:31 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <fstream.h>
fstream f("euclid2.in");
fstream g("euclid2.out");
long cmmdc(long x, long y)
{
if (x==0)
return x;
cmmdc(x,x%y);
}
int main()
{
long a,b;
f>>a>>b;
g<<cmmdc(a,b);
}