Cod sursa(job #1172038)
Utilizator | Data | 16 aprilie 2014 18:07:22 | |
---|---|---|---|
Problema | Jocul Flip | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
using namespace std;
ifstream fin("cmmdc.in");
ofstream fout("cmmdc.out");
int main()
{
int a,b;
fin>>a>>b;
while(a!=b)
{if(a>b)
a=a-b;
if(a<b)
b=b-a;}
if(a==1)
fout<<0;
else
fout<<a;
return 0;
}