Advertisement
alex326

Untitled

Jan 22nd, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. problema 375
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,d=2,ok=0,x=0;
  8. cin>>n;
  9. while (x!=1){
  10. n++;
  11. d=2;
  12. ok=0;
  13. while (d*d<=n && ok==0){
  14. if (n%d==0)
  15. ok=1;
  16. d++;
  17. }
  18. if (ok==0)
  19. x=1;
  20. }
  21. cout<<n;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement