Cod sursa(job #152238)
| Utilizator | Data | 9 martie 2008 11:41:04 | |
|---|---|---|---|
| Problema | Algoritmul lui Euclid | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.34 kb |
# include <stdio.h>
# define input "euclid2.in"
# define output "euclid2.out"
int x,y,r;
int main()
{
freopen(input, "r", stdin);
freopen(output, "w",stdout);
scanf("%d%d",&x,&y);
while(y)
{
r = x%y;
x=y;
y=r;
}
printf("%d",x);
return 0;
}
