Cod sursa(job #145208)
Utilizator | Data | 28 februarie 2008 16:27:45 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include <stdio.h>
#define INPUT "euclid2.in"
#define OUTPUT "euclid2.out"
int a,b;
int main()
{
freopen(INPUT,"r",stdin);
freopen(OUTPUT,"w",stdout);
scanf("%d%d",&a,&b);
while (b!=0)
{ int c=a; a=b; b=c%b; }
printf("%d\n",a);
fclose(stdin);
fclose(stdout);
return 0;
}