标签:des style blog http color java os io strong
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1395
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12146 Accepted Submission(s):
3797
1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 int main () 6 { 7 int n; 8 while (cin>>n) 9 { 10 if (n%2&&n>1) 11 { 12 int s=1,x=1; 13 while (x) 14 { 15 s=s*2%n; 16 if (s==1) 17 { 18 printf ("2^%d mod %d = 1\n",x,n); 19 break; 20 } 21 x++; 22 } 23 } 24 else 25 printf ("2^? mod %d = 1\n",n); 26 } 27 return 0; 28 }
标签:des style blog http color java os io strong
原文地址:http://www.cnblogs.com/qq-star/p/3930924.html