Cod sursa(job #1928456)
Utilizator | Jinga Tudor Herddex | Data | 16 martie 2017 12:23:44 |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
using namespace std;
ifstream fin("test.in");
ofstream fout("test.out");
unsigned long long t,a,b,c;
int main()
{
fin>>t;
for(;t;t--)
{
fin>>a>>b;
while(b)
{
c=b;
b=a%c;
a=c;
}
fout<<a<<'\n';
}
fin.close();
fout.close();
return 0;
}