Cod sursa(job #2183354)
Utilizator | Data | 23 martie 2018 08:50:31 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.3 kb |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ifstream in("euclid2.in");
ofstream out("euclid2.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;
}