Cod sursa(job #2569281)

Utilizator cyg_Alex_codegicianBarbu Alexandru cyg_Alex_codegician Data 4 martie 2020 11:43:27
Problema Algoritmul lui Euclid Scor 100
Compilator cpp-64 Status done
Runda r3capitusulare Marime 0.32 kb
#include <fstream>
using namespace std;
ifstream fin ("euclid2.in");
ofstream fout ("euclid2.out");
int main()
{
    int t;
    fin >> t;
    while (t--)
    {
        int a,b,r=0;
        fin >> a >> b;
        while (b)
        {
            r=a%b;
            a=b;
            b=r;
        }
        fout << a << '\n';
    }
}