You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include<stdio.h>
|
|
#include<math.h>
|
|
int fun(int a)
|
|
{
|
|
int ans = 0;
|
|
for(int i = 2; i <= sqrt(a); i++)
|
|
{
|
|
if(a%i==0)
|
|
{
|
|
ans = 1;
|
|
break;
|
|
}
|
|
}
|
|
return ans;
|
|
}
|
|
int main()
|
|
{
|
|
int a;
|
|
scanf("%d",&a);
|
|
int ans = fun(a);
|
|
if(ans == 1) printf("NO");
|
|
else printf("YES");
|
|
} |