SHARE
TWEET

Untitled

a guest Nov 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     unsigned int n, p=1, d, nd;
  8.     cin >> n;
  9.     while(n!=0)
  10.     {
  11.         nd = 0;
  12.         d = 1;
  13.         while(d<=p)
  14.         {
  15.             if(p%d==0)
  16.             {
  17.                 nd = nd + 1;
  18.             }
  19.             d = d + 1;
  20.  
  21.         }
  22.         if(nd==2)
  23.         {
  24.              n = n -1;
  25.              cout << p << "\n";
  26.         }
  27.  
  28.         p = p + 1;
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top