Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
39776 奚晨瑞 第n小的质数 C++ Accepted 1 MS 252 KB 290 2024-02-04 15:30:01

Tests(1/1):


#include<iostream> using namespace std; int main() { int n; cin>>n; int S=0; for(int j=2;;j++){ bool a=1; for(int i=1;i*i<=j;i++){ if(j%i==0&&i>1){ a=0; break; } } if(a==1){ S++; } if(S==n){ cout<<j; break; } } return 0; }


Judgement Protocol: