Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- problema 374
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,d=2,ok=0,a=2;
- cin>>n;
- while (a<=n){
- d=2;
- ok=0;
- while (d<=a/2){
- if (a%d==0)
- ok=1;
- d++;
- }
- if (ok==0)
- cout<<a<<" ";
- a++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement