Cod sursa(job #3325106)

Utilizator tryharderulbrebenel mihnea stefan tryharderul Data 24 noiembrie 2025 19:44:56
Problema Algoritmul lui Euclid Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.31 kb
#include <bits/stdc++.h>

using namespace std;

ifstream in("euclid2.in");
ofstream out("euclid2.out");

int gcd(int x, int y) {
	if(!y) { return x; }
	return gcd(y, x % y);
}

int main() {

	int t;
	in >> t;

	while(t--) {
		int x, y;
		in >> x >> y;
		out << gcd(x, y) << '\n';
	}

	return 0;
}