#include <stdio.h>
int isPrimeNumber(int num){
if(num <= 1){
return 0; //Retorna falso
} else {
int quant = num / 2;
for(; quant >= 2; --quant)
if(num % quant == 0)
return 0; //Retorna falso
return 1; //Retorna verdadeiro
}
}
int main(){
int num;
scanf("%d", &num);
if(isPrimeNumber(num)){
printf("%d eh um numero primo.\n", num);
} else {
printf("%d nao eh um numero primo.\n", num);
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBpc1ByaW1lTnVtYmVyKGludCBudW0pewogICAgaWYobnVtIDw9IDEpewogICAgCXJldHVybiAwOyAvL1JldG9ybmEgZmFsc28KICAgIH0gZWxzZSB7CiAgICAJaW50IHF1YW50ID0gbnVtIC8gMjsKICAgIAlmb3IoOyBxdWFudCA+PSAyOyAtLXF1YW50KQogICAgCQlpZihudW0gJSBxdWFudCA9PSAwKQogICAgCQkJcmV0dXJuIDA7IC8vUmV0b3JuYSBmYWxzbwogICAgCXJldHVybiAxOyAvL1JldG9ybmEgdmVyZGFkZWlybwogICAgfQp9CgppbnQgbWFpbigpewoJaW50IG51bTsKCXNjYW5mKCIlZCIsICZudW0pOwoJaWYoaXNQcmltZU51bWJlcihudW0pKXsKCQlwcmludGYoIiVkIGVoIHVtIG51bWVybyBwcmltby5cbiIsIG51bSk7Cgl9IGVsc2UgewoJCXByaW50ZigiJWQgbmFvIGVoIHVtIG51bWVybyBwcmltby5cbiIsIG51bSk7Cgl9CglyZXR1cm4gMDsKfQ==