Cod sursa(job #149789)
Utilizator | Data | 6 martie 2008 05:59:41 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include <stdio.h>
long a, b;
long cmmdc(long a, long b){
if(b==0) return a;
return cmmdc(b, a%b);
}
int main()
{
freopen("euclid2.in", "r", stdin);
freopen("euclid2.out", "w", stdout);
scanf("%ld %ld", &a, &b);
printf("%ld\n", cmmdc(a, b));
return 0;
}