#include <iostream>

using namespace std;

int main()

{

              int get_num,min_remainder=1,remainder,index=2;

              cout << "整数を入力してください" << endl;

              cin >> get_num;

              if(get_num == 1)

              {

                            min_remainder=0;

              }

              if(get_num > 2 && get_num%2 == 0)

              {

                            min_remainder=0;

              }

              while(index*index <= get_num)

              {

                  remainder = get_num%index;

                  if(remainder < min_remainder)

                  {

                      min_remainder=0;

                  }

                  index++;

              }

              if(min_remainder !=0)

              {

                  cout << get_num << "は素数です" << endl;

              }

              else

              {

            cout << get_num << "は素数ではありません" << endl;

             }
return 0;

}