帮我讲一下杭电1014的题目意思吧····

2024-12-25 19:10:20
推荐回答(1个)
回答1:

#include
#include
#include
using namespace std;
int main()
{
int step,mod;
char good[20]="Good Choice";
char bad[20] = "Bad Choice";
while(cin>>step>>mod)
{
list listobject;
int seed=0;
while(1)
{
listobject.push_back(seed);
seed = (seed + step)% mod;
//格式化输出
if(listobject.size()== mod)
{
printf("%10d%10d %-5s\n\n",step,mod,good);
break;
}
else if(seed == 0)
{
printf("%10d%10d %-5s\n\n",step,mod,bad);
break;
}
}
}
return 0;
}

是这个1014??