Cod sursa(job #2569910)
Utilizator | Data | 4 martie 2020 14:14:38 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | r3capitusulare | Marime | 0.33 kb |
#include <bits/stdc++.h>
#define dbg() cerr <<
#define name(x) (#x) << ": " << (x) << ' ' <<
using namespace std;
int main() {
ifstream cin("euclid2.in");
ofstream cout("euclid2.out");
int t; cin >> t;
while (t--) {
int a, b; cin >> a >> b;
while (b) {
a %= b;
swap(a, b);
}
cout << a << '\n';
}
}