Advertisement
alex326

Untitled

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