Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using std::cin;
  4. using std::cout;
  5. using std::endl;
  6.  
  7. int main()
  8. {
  9. int num, i, thing = 1;
  10. cin >> num;
  11. if (num <= 2)
  12. cout << 0;
  13.  
  14. else {
  15. for(i=2; i < sqrt(num); i++) {
  16. if(num%i==0)
  17. thing = 0;
  18. }
  19. }
  20.  
  21. if (thing = 0)
  22. cout << 0;
  23. else
  24. cout << 1;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement