#include<bits/stdc++.h>
using namespace std;
define N 1000000
int b[1000005], n, cnt;
int main(){
scanf("%d",&n);
for(int i = 2; i*i <= N; i++){
for(int j = i*i; j <= N; j += i)
b[j] = 1;
}
for(int i = 2; i <= N; i++)
if(b[i] == 0){
cnt++;
if(cnt == n) cout<<i<<endl;
}
return 0;
}
标签:std,cnt,埃氏,int,质数,main
From: https://www.cnblogs.com/caterpillor/p/17396874.html