Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
33190 | 黄泽远小号 | 【入门】第n小的质数 | C++ | 通过 | 24 MS | 248 KB | 341 | 2023-12-24 14:12:31 |
#include "iostream" #define int long long using namespace std; bool check(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0)return false; } return true; } signed main(){ int n; int ans=2; int i=0; cin>>n; while(n){ if(check(ans)){ i++; } if(i==n){ cout<<ans; return 0; } ans++; } return 0; }