Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. package test;
  2. class Problem7 {
  3. public static void main(String args[]) {
  4. int count=0;
  5. long n=3;
  6. long f=1;
  7. long result=0;
  8. outerLoop:while(n>1){
  9. innerLoop:for(long i=2;i<n/2;i++){
  10. if(n%i==0){
  11. f=f+1;
  12. }
  13. if(f>1)
  14. {
  15. break innerLoop;
  16. }
  17. }
  18.  
  19. if(f<2){
  20. result=n;
  21. count=count+1;
  22. }
  23. if(count<10002){
  24. n++;
  25. }
  26. if(count==10002){
  27. System.out.println(+result);
  28. break outerLoop;
  29. }
  30. }
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement