Cod sursa(job #2421403)
Utilizator | Data | 15 mai 2019 00:26:18 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("date.in");
ofstream g("date.out");
int main()
{
int n, a, b, aux;
f >> n;
while (n)
{
--n;
f >> a >> b;
while (b)
{
aux = a;
a = b;
b = aux % b;
}
g << a << '\n';
}
return 0;
}