Guest User

Untitled

a guest
Feb 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1.  
  2. public class isPrim {
  3.  
  4.  
  5.  
  6. public static void main(String[] args) {
  7.  
  8. long x = 67001;
  9.  
  10. System.out.println(isPrimz(x,x-1));
  11.  
  12. }
  13. static long v = 1;
  14.  
  15. public static boolean isPrimz(long n, long m){
  16. System.out.println(v);
  17. v++;
  18. if (m==1) return true;
  19.  
  20. else if(n%m != 0) return isPrimz(n,m-1);
  21.  
  22. else System.out.println(m);
  23. return false;
  24.  
  25.  
  26.  
  27.  
  28. }
  29.  
  30.  
  31. }
Add Comment
Please, Sign In to add comment