Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <stdio.h>
- #include <conio.h>
- using namespace std;
- int main()
- {
- for (int i=2; i<1000; i++)
- {
- bool pierwsza = true;
- for(int j = 2; j*j<=i; j++)
- {
- if(i % j == 0)
- {
- pierwsza = false;
- break;
- }
- }
- if(pierwsza) cout<<i<<" ";
- }
- return 42;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement