Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pertemuan4;
- public class nomor1 {
- static int ack(int m, int n) {
- if (m == 0)
- {return n + 1;}
- else if((m > 0) && (n == 0))
- {return ack(m - 1, 1);}
- else if((m > 0) && (n > 0))
- {return ack(m - 1, ack(m, n - 1));}
- else
- return n + 1;
- }
- public static void main(String args[])
- {
- System.out.println(ack(2, 9));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement