#include<stdio.h>
int math(int x)
{
int a = 0, b=0;
for (a = 2; a < x ; a++)
{
if (x % a == 0)//如果是合数输出b=1
{
b = 1;
break;
}
}
if (b == 1)
return 0;
else
return 1;
}
int main()
{
int a, b, c=0, d;
printf("Input n:");
scanf_s("%d", &a);
for (b = a+1; c == 0; b++)
{
c = math(b);
if (c == 1)
break;
}
printf("%d", b);
return 0;
}