Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool bilprima (int a) {
- if(a==2) {
- return true;
- }
- for(int b=2;b<a;b++) {
- if(a%b==0)
- return false;
- }
- return true;
- }
- int main() {
- for(int i=2;i<=100;i++) {
- if(bilprima(i)) cout << i << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement