Cod sursa(job #2251069)

Utilizator Balauta_AlbertBalauta Albert Balauta_Albert Data 1 octombrie 2018 09:23:03
Problema Algoritmul lui Euclid Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <fstream>

using namespace std;

ifstream fin ("euclid2.in");
ofstream fout ("euclid2.out");

long long CMMDC(long long a,long long b)
{
    if(b==0)return a;
    return CMMDC(b,a%b);
}


int main()
{

    long long n,a,b;

    fin >> n;

    for(int i=1;i<=n;++i)
    {
    fin >> a >> b;
    fout << CMMDC(a,b) << "\n";
    }




    return 0;
}