Cod sursa(job #935348)

Utilizator IvanoiuStefanIvanoiu George Stefan IvanoiuStefan Data 3 aprilie 2013 01:23:39
Problema Fractii Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.27 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
int a,b,r;
int main ()
{
    f>>a>>b;
    do {r=a%b;
        a=b;
        b=r;} while (r);
    g<<a;
    f.close ();
    g.close ();
    return 0;
}