#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <sstream>
#include <climits>
#include <cstring>
using namespace std;
//1040
const int mx=1000000;
int p[mx];
bool mark[mx];
void init(){
long long i,j;
int cnt=0;
for(i=2;i<mx;i++){
if(mark[i]) continue;
p[cnt++]=i;
for(j=i*i;j<mx;j+=i)
mark[j]=true;
}
}
int main(){
int k;
init();
while(cin>>k){
cout<<p[k-1]<<endl;
}
return 0;
}
/**************************************************************
Problem: 1040
User: cust123
Language: C++
Result: Accepted
Time:10 ms
Memory:6400 kb
****************************************************************/
转载请注明原文地址: https://ju.6miu.com/read-664887.html