Cod sursa(job #2365274)

Utilizator TeddyDinutaDinuta Eduard Stefan TeddyDinuta Data 4 martie 2019 12:45:35
Problema Algoritmul lui Euclid Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.32 kb
#include <bits/stdc++.h>

using namespace std;
ifstream in("euclid2.in");
ofstream out("euclid2.out");
long long t,a,b;
int gcd(int a,int b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
int main()
{
    in>>t;
    while(t--)
    {
        in>>a>>b;
        out<<gcd(a,b);
    }
    return 0;
}