文章
116
粉丝
69
获赞
655
访问
82.1k
#include<bits/stdc++.h>
using namespace std;
int n;
bool cheak(int n)
{
if(n == 1) return false;
for(int i = 2; i * i < n; i ++)
if(n % i == 0) return false;
return true;
}
int main()
{
cin >> n;
if(cheak(n)) cout << n;
else
{
for(int i = n; ;i ++)
{
if(cheak(i))
{
cout << i;
break;
}
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发