首页 > 其他 > 详细

Torry的困惑(基本型)

时间:2016-01-19 00:09:38      阅读:189      评论:0      收藏:0      [点我收藏+]
技术分享
 1 #include <cstdio>
 2 
 3 #include <cmath>
 4 using namespace std;
 5 
 6 bool isprime(int x)
 7 {
 8     int i;
 9     for(i=2;i<=sqrt((double)x);i++)
10     {
11         if(x%i==0)
12         return false;
13     }
14     return true;
15 }
16 int main()
17 {
18     int n,i,cn,cj;
19     while(~scanf("%d",&n))
20     {
21         cj=1;
22         for(i=2,cn=0;cn<n;i++)
23         {
24             if(isprime(i))
25             {
26                 cj=(cj*i)%50000;
27                 cn++;
28             }
29             
30         }
31         printf("%d\n",cj);
32     }
33     return 0;
34 }
View Code

 

Torry的困惑(基本型)

原文:http://www.cnblogs.com/WDKER/p/5140677.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!