Cod sursa(job #2105019)

Utilizator mihai50000Mihai-Cristian Popescu mihai50000 Data 12 ianuarie 2018 15:18:55
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include <fstream>

using namespace std;
ifstream f("cmmdc.in");
ofstream g("cmmdc.out");
int a,b,r;
int main()
{
    f>>a>>b;
    r=a%b;
    while(r)
    {
        a=b;
        b=r;
        r=a%b;
    }
    if(b==1)
        g<<0;
        else
            g<<b;
    return 0;
}