Untitled
#include <iostream> using namespace std; int main() { int a, i, summ = 0; cin >> a; for (i = 1; i < a+1; i++) { if (a % i == 0)summ += 1; } if (summ == 2) cout << "Yes"; else cout << "No"; }
#include <iostream> using namespace std; int main() { int a, i, summ = 0; cin >> a; for (i = 1; i < a+1; i++) { if (a % i == 0)summ += 1; } if (summ == 2) cout << "Yes"; else cout << "No"; }