Cod sursa(job #779594)

Utilizator andreeainfo_dAndreea Dutulescu andreeainfo_d Data 18 august 2012 10:03:49
Problema Jocul Flip Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
using namespace std;
#include<stdio.h>
int a,b,aux;
int main()
{
	freopen("cmmdc.in","r",stdin);
	freopen("cmmdc.out","w",stdout);
	scanf("%d%d",&a,&b);
	while(a!=0)
	{
		if(a<b)
		{
			aux=a;
			a=b;
			b=aux;
		}
		a=a-b;
	}
	printf("%d",b);
	return 0;
}