Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool test(long prime)
- {
- for (i = 2; i <= sqrt(prime); i++){
- if (prime % i == 0) return false;
- }
- return true;
- }
- int main()
- {
- long x;
- cin >> x;
- if (test(x)){
- cout << "yes\n";
- }
- else{
- cout << "no\n";
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement