Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Input {
- public static void main(String[] args){
- Scanner sc = new Scanner(System.in);
- int ref=0;
- int a = sc.nextInt();
- int i =0;
- int state=0;
- String prime="";
- if(a==1){
- System.out.println(2);
- }else if(a>1){
- ref=1;
- for(i =2;i<300000;i++){
- for(int j =2;j<i;j++){
- state = j;
- if(i%j==0){
- break;
- }
- }
- if(state==i-1){
- ref+=1;
- }
- if(ref==a){
- System.out.println(i);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement