Cod sursa(job #2183353)
Utilizator | Data | 23 martie 2018 08:50:02 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.29 kb |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ifstream in("tst.in");
ofstream out("tst.out");
ll x, y;
int t;
ll gcd(ll a, ll b){
return (!b ? a : gcd(b, a % b));
}
int main(){
in >> t;
while(in >> x >> y)
out << gcd(x, y) << '\n';
return 0;
}