UVA 408 (暑假-数论 -D - Uniform Generator)

#include <cstdio>

int main() {
	int n, m;
	while (scanf("%d%d", &n, &m) != EOF) {
		int count = 1;
		for (int i = 1; i <= n && i <= m; i++) {
			if (n % i == 0 && m % i == 0)
				count = i;
		}
		
		if (count == 1)
			printf("%10d%10d    Good Choice\n\n", n, m);
		else
			printf("%10d%10d    Bad Choice\n\n", n, m);
	}

	return 0;
}

你可能感兴趣的:(UVA 408 (暑假-数论 -D - Uniform Generator))