Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //#include <fstream>
- using namespace std;
- int main()
- {
- //ifstream cin("input.txt");
- short n;
- cin>>n;
- short i = 1;
- long cur = 2;
- while(i!=n)
- {
- cur++;
- bool a = true;
- for (long j=2; j<cur; j++)
- if (cur%j==0)
- {
- a = false;
- break;
- }
- if (a)
- i++;
- }
- cout<<cur;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement