Cod sursa(job #2282314)
Utilizator | Data | 13 noiembrie 2018 16:48:49 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
using namespace std;
ifstream fin("euclid2.in");
ofstream fout("euclid2.out");
int t,a,b;
int cmmdc(int a,int b) {
if (b==0)
return a;
return cmmdc(b,a%b);
}
int main() {
fin>>t;
while (t--) {
fin>>a>>b;
fout<<cmmdc(a,b)<<"\n";
}
return 0;
}