Rofyda_Elghadban1

Untitled

Aug 20th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <algorithm>
  5. #include <cstdlib>
  6. #include <limits.h>
  7. #include <string>
  8.  
  9. #define ll long long
  10.  
  11. using namespace std;
  12. void Fast_IO();
  13. void Rofyda_Elghadban(){
  14. #ifndef ONLINE_JUDGE
  15. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  16. #endif
  17. }
  18. int main()
  19. { Rofyda_Elghadban();
  20. //Fast_IO();
  21. //freopen("input.txt","r",stdin);
  22. //freopen("output.txt","r",stdout);
  23. ll n;
  24. cin>>n;
  25. int flag=0;
  26. if(n>=2){
  27. for(int i=2;i<=n/2;i++){
  28. if(n%i==0){
  29. cout<<"NO"<<endl;
  30. flag=1;
  31. break;
  32. }
  33. } if(flag==0){
  34. cout<<"YES"<<endl;
  35. }
  36. }else{
  37. cout<<"NO"<<endl;
  38. }
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. return 0;
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment