Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. { int n, ok = 1, radical; cin >> n; int nr = n;
  6. while( ok )
  7. { ++nr; bool ok1 = 0;
  8. radical = sqrt(nr);
  9. for( int i = 2; i <= radical; ++i)
  10. {
  11. if(!(nr % i))
  12. {
  13. ok1 = 1;
  14. }
  15. }
  16. if(ok1==0)
  17. ok = 0;
  18. }
  19. cout << nr;
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement