Guest User

Untitled

a guest
Mar 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int _tmain(int argc, _TCHAR* argv[])
  2. {
  3. int osztodb = 0;
  4. bool prime = false;
  5. for(int i = 0;i < 120;i++)
  6. {
  7.  
  8. for(int s = 3; s <= i; s++)
  9. {
  10. prime = true;
  11. for(int n = 2; n <= s - 1; n++)
  12. {
  13. if(s % n == 0){
  14.  
  15. prime = false;
  16. }
  17. }
  18. }
  19. if (prime)
  20. std::cout << i << std::endl;
  21.  
  22. }
  23. std::getchar();
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment