#include <iostream>

using namespace std;

int getClosestPrime(int inputNum){
    bool isPrime = false;
    inputNum++;
    while (!isPrime){
        for (int i = 2; i <= inputNum/2; i++){
            if (inputNum % i == 0){
                isPrime = false;
                break; //if at any time found it's not a prime, break the for loop
            }
            isPrime = true;
        }
        if (isPrime == false){
            inputNum++;
        } else {
            return inputNum;
        }
    }
}

int main()
{
    int a = getClosestPrime(1258);
    cout <<"1259?"<<endl;
    cout <<a<<endl;
    a = getClosestPrime(1259);
    cout <<"1277?"<<endl;
    cout <<a;
}
