From 302cb1ffd19e6bba1e8307c0b2fa31233f9c8c4d Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Fri, 12 Aug 2016 10:12:09 +0800 Subject: [PATCH] Add files via upload --- HDOJ/1014_autoAC.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 HDOJ/1014_autoAC.cpp diff --git a/HDOJ/1014_autoAC.cpp b/HDOJ/1014_autoAC.cpp new file mode 100644 index 0000000..2e1f0de --- /dev/null +++ b/HDOJ/1014_autoAC.cpp @@ -0,0 +1,25 @@ +#include +#include +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; +}