http://oj.ecustacm.cn/problem.php?id=1471
用筛选法
#include<cstdio>
#include<iostream>
using namespace std;
bool a[10000005]={
false};
int main(void)
{
int temp=0;
int n=0;
int i;
for(i=2;i<=10000000;i++)
{
if(a[i]==false)
{
int j=2;
temp=i;
n++;
while(i*j<=10000000)
{
temp=i*j;
a[temp]=true;
j++;
}
}
if(n==2019)
{
printf("%d\n",i);//判断是不是找到了
break;
}
}
printf("%d\n",i);
return 0;
}