60分求助
查看原帖
60分求助
1320784
yinzixia楼主2024/4/20 19:59
#include<bits/stdc++.h>
using namespace std;
bool ys(int x){
	for(int j=2;j<x;j++){
		if(x%j==0)return false;
	}
	return true;
}
int main(){
	int n,ans,t=0;
	cin>>n;
	for(int i=2;;i++){
		if(ys(i)==true){
			t++;
			if(t==n){
				cout<<i;
				return 0;
			}
		}
	}
}
2024/4/20 19:59
加载中...