#include <stdio.h>
int main(void) {
int num, i, isPrime = 1; // isPrimeは素数判定用フラグ
if (num <= 1) {
return 0;
}
for (i = 2; i * i <= num; i++) {
if (num % i == 0) {
isPrime = 0; // 割り切れたら素数ではない
break;
}
}
if (isPrime) {
} else {
printf("%d は素数ではありません。\n", num
); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgbnVtLCBpLCBpc1ByaW1lID0gMTsgIC8vIGlzUHJpbWXjga/ntKDmlbDliKTlrprnlKjjg5Xjg6njgrAKCiAgICBwcmludGYoIuaVtOaVsOOCkuWFpeWKm+OBl+OBpuOBj+OBoOOBleOBhDogIik7CiAgICBzY2FuZigiJWQiLCAmbnVtKTsKCiAgICBpZiAobnVtIDw9IDEpIHsKICAgICAgICBwcmludGYoIjHku6XkuIrjga7mlbTmlbDjgpLlhaXlipvjgZfjgabjgY/jgaDjgZXjgYTjgIJcbiIpOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIGZvciAoaSA9IDI7IGkgKiBpIDw9IG51bTsgaSsrKSB7CiAgICAgICAgaWYgKG51bSAlIGkgPT0gMCkgewogICAgICAgICAgICBpc1ByaW1lID0gMDsgIC8vIOWJsuOCiuWIh+OCjOOBn+OCiee0oOaVsOOBp+OBr+OBquOBhAogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICB9CgogICAgaWYgKGlzUHJpbWUpIHsKICAgICAgICBwcmludGYoIiVkIOOBr+e0oOaVsOOBp+OBmeOAglxuIiwgbnVtKTsKICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCIlZCDjga/ntKDmlbDjgafjga/jgYLjgorjgb7jgZvjgpPjgIJcbiIsIG51bSk7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0K