Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double simpletest(long long a){
- for (int i=2; i<sqrt(a);i++){
- if (!(a%i))
- return false;
- }
- return true;
- }
- int main(int argc, char *argv[])
- {
- long long a;
- cin >> a;
- for (int i=2; i<=sqrt(a);i++){
- if (!(a%i)){
- cout << (simpletest(i)&&simpletest(a/i)?"Yes":"No");
- return 0;
- }
- }
- cout << "No"; // if input value -- simple
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement