mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Add files via upload
This commit is contained in:
parent
faae224e74
commit
302cb1ffd1
25
HDOJ/1014_autoAC.cpp
Normal file
25
HDOJ/1014_autoAC.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdio>
|
||||||
|
using namespace std;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
unsigned int STEP,MOD;
|
||||||
|
while(cin>>STEP>>MOD)
|
||||||
|
{
|
||||||
|
int count = 1;
|
||||||
|
int seed = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
seed = (seed + STEP)%MOD;
|
||||||
|
++count;
|
||||||
|
} while(seed != 0);
|
||||||
|
--count;
|
||||||
|
printf("%10d%10d ",STEP,MOD);
|
||||||
|
if(count == MOD)
|
||||||
|
printf("%s\n","Good Choice");
|
||||||
|
else
|
||||||
|
printf("%s\n","Bad Choice");
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user