AC

lkyLKY(祝忘羡99版)  •  8天前


include

using namespace std;

int main() {

int t;
cin >> t;
int a[t][2];
for (int i = 0; i < t; i++) {
	scanf("%d %d", &a[i][0], &a[i][1]);
}
for (int i = 0; i < t; i++) {
	int n = a[i][0], m = a[i][1];
	if (n < m) {
		swap(n, m);
	}
	while (m != 0) {
		int t = n % m;
		n = m;
		m = t;
	}
	printf("%d\n", n);
}
return 0;

}


评论:

请先登录,才能进行评论