#include <iostream>
#include <math.h>

using namespace std;

int main()
{
 int n,cont=1,i=3,reg=2;
 char flag;
 cin>>n;
 int s[200000];
 s[0]=2;
 while(cont<n){
  flag=0;
  for(int j=0;j<cont;j++){
   if(i%s[j]==0){flag=1;break;}
   if(s[j]>=sqrt(i))break;
  }
  if(flag==0){reg=i;s[cont]=reg;cont++;}
  i+=2;
 }
 cout<<reg<<endl;
    system("pause");
    return 0;
}


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 h881068 的頭像
    h881068

    DRGO

    h881068 發表在 痞客邦 留言(0) 人氣()