1 #include<iostream>
 2 #include<cmath>
 3 using namespace std;
 4 int main()
 5 {
 6    int n;
 7    cin>>n;
 8    if(n==1) {
 9      cout<<2<<endl;
10      return 0;
11    }
12    n=n-1;
13    int t=3;
14    while(t<=104730){
15        bool flag=true;
16        for( int i=2;i<=sqrt(t);i++){
17           if(t%i==0) flag = false;
18           continue;
19        }
20        if(flag==true) {
21            n--;
22            if(n==0){
23                cout<<t<<endl;
24                return 0;
25            }
26        }
27        t=t+2;
28    }
29 }

 

posted on 2016-10-22 13:48  任我主宰  阅读(138)  评论(0编辑  收藏  举报