Advertisement
KitsuneFTW

Untitled

Dec 7th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class T3Array {
  2.  
  3. public static boolean metodoRIc (int[]x){
  4. if(x!=null&&x.length>0)
  5. return metodoRIc(x,x.length-1);
  6. else return false;
  7. }
  8. private static boolean metodoRIc (int[]x, int i){
  9. if(i==0)
  10. return x[i]%2==0;
  11. else
  12. return x[i]%2==0 && metodoRIc(x, i=i-1);
  13. }
  14. public static boolean metodoRIcc(int[]x,int i){
  15. if(i==x.length-1)
  16. return x[i]%2==0;
  17. else
  18. return x[i]%2==0 && metodoRIc(x, i++);
  19.  
  20. }
  21. public static void main(String args[]){
  22.  
  23. int [] x= {2,2,2,2,2};
  24. System.out.println(metodoRIc(x));
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement