您的位置:首页 > 其它

hdu 1014 Uniform Generator

2011-12-03 21:17 323 查看
题目: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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: