Guest User

Untitled

a guest
Feb 14th, 2020
87
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int i,n,gasit,ok,d;
  4. int main()
  5. {
  6. cin>>n;
  7. gasit=0;
  8. d=n+1;
  9. while(gasit==0)
  10. {
  11. ok=1;
  12. if(d<2)
  13. ok=0;
  14. else
  15. {
  16. for(i=2; i*i<=d; i++)
  17. if(d%i==0)
  18. {
  19. ok=0;
  20. break;
  21. }
  22.  
  23. if(ok==1)
  24. {
  25. cout<<d;
  26. gasit=1;
  27.  
  28. }
  29. else d++;
  30.  
  31. }
  32. }
  33. return 0;
  34. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×