0分求助!!!!!!(用示例试了一下可以,提交后一片黑)
查看原帖
0分求助!!!!!!(用示例试了一下可以,提交后一片黑)
1031685
tomorrow1w楼主2023/7/30 15:57
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,i,s=0;
	cin >>n;
	for(i=2;;++i){
		int x=2;
		while(x<=floor(sqrt(i))&&i%x!=0) x++;
		if(x>floor(sqrt(i))){
			s++;
			if(s==n)
			{
				cout << i << endl;
			}
		}
	}
	return 0;
}

2023/7/30 15:57
加载中...