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