Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Recursion
- {
- public static void main(String[] args)
- {
- f(3);
- }
- public static void f(int x)
- {
- if(x>0)
- {
- System.out.println(x + "top");
- f(x-1);
- System.out.println(x + "bottom");
- f(x-1);
- }
- System.out.println("bert");
- }
- }
Add Comment
Please, Sign In to add comment