Cod sursa(job #1356511)
Utilizator | Data | 23 februarie 2015 14:22:05 | |
---|---|---|---|
Problema | A+B | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
int main()
{
int a,b;
f>>a>>b;
while(a!=b)
{
if(a>b)
{
a=a-b;
}
else{
b=b-a;
}
}
g<<a;
return 0;
}