Advertisement
vladm98

Untitled

Jul 19th, 2017
53
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 <math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n, suma = 0, i;
  8. cin >> n;
  9. bool ok;
  10. ok = true;
  11. for (i = 2; i*i<=n; ++i)
  12. {
  13. if (n%i==0)
  14. ok= false;
  15. }
  16. if (ok == true)
  17. cout << "ESTE PRIM";
  18. else cout << "NU ESTE PRIM";
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement