Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- class Problem7 {
- public static void main(String args[]) {
- int count=0;
- long n=3;
- long f=1;
- long result=0;
- outerLoop:while(n>1){
- innerLoop:for(long i=2;i<n/2;i++){
- if(n%i==0){
- f=f+1;
- }
- if(f>1)
- {
- break innerLoop;
- }
- }
- if(f<2){
- result=n;
- count=count+1;
- }
- if(count<10002){
- n++;
- }
- if(count==10002){
- System.out.println(+result);
- break outerLoop;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement