Cod sursa(job #1244246)

Utilizator Georgia29Ghgeorghiciuc Georgia Georgia29 Data 16 octombrie 2014 22:50:44
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.26 kb
#include <fstream>
using namespace std;
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
int a,b;
int main()
{  f>>a>>b;
    while(a!=b)
    { if(a>b) a=a-b;
      else b=b-a;
    }
    if(a==1)g<<"0";
    else g<<a;
    g.close();
    return 0;
}