fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool isPrime(int x){
  5. if (x < 2) return false;
  6. for (int i = 2; i*i <= x; i++){
  7. if (x%i == 0) return false;
  8. } return true;
  9. }
  10.  
  11. int main() {
  12. int N;
  13. cin >> N;
  14. if (isPrime(N)) cout << "yes" << endl;
  15. else cout << "no" << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5288KB
stdin
101
stdout
yes