Cod sursa(job #2639320)
| Utilizator | Data | 1 august 2020 13:51:32 | |
|---|---|---|---|
| Problema | Algoritmul lui Euclid | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("euclid2.in");
ofstream g("euclid2.out");
long int cmmdc(long int a,long int b)
{
if(b)
return cmmdc(a,b);
else
{
return a;
}
}
int main()
{
int nr;
f>>nr;
long int x,y;
while (nr--)
{
f>>x,f>>y;
g<<cmmdc(x,y)<<endl;
}
return 0;
}
