题目:http://acm.hdu.edu.cn/showproblem.php?pid=1014
水题。。。直接模拟
下面是AC代码
#include<iostream>
using namespace std;
int main()
{
int s,m,x,c;
while(scanf("%d%d",&s,&m)!=EOF)
{
x=c=0;
do
{
x=(x+s)%m;
++c;
} while(x!=0);
if(c==m)
printf("%10d%10d Good Choice\n\n",s,m);
else
printf("%10d%10d Bad Choice\n\n",s,m);
}
return 0;
}