fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long x,y=0;
  8. cin>>x;
  9.  
  10. for(int i=2;i<=x/2;i++){
  11. if(x%i==0){
  12. y=1;
  13. cout<<"NO";
  14. break;
  15. }
  16.  
  17. }
  18. if(y==0){
  19. cout<<"YES";
  20. }
  21. }
  22.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
NO