问题最后转化成求两个数的最大公约数,如果为1就YES.
#include <stdio.h>
int main(){
int step, mod, t;
while(scanf("%d%d", &step, &mod) == 2){
printf("%10d%10d", step, mod);
while(mod){
t = step % mod;
step = mod;
mod = t;
}
printf(" %s\n\n", step == 1? "Good Choice": "Bad Choice");
}
return 0;
}