Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int _tmain(int argc, _TCHAR* argv[])
- {
- int osztodb = 0;
- bool prime = false;
- for(int i = 0;i < 120;i++)
- {
- for(int s = 3; s <= i; s++)
- {
- prime = true;
- for(int n = 2; n <= s - 1; n++)
- {
- if(s % n == 0){
- prime = false;
- }
- }
- }
- if (prime)
- std::cout << i << std::endl;
- }
- std::getchar();
- return 0;
- }
Add Comment
Please, Sign In to add comment