(int n)
| 18 | } |
| 19 | |
| 20 | public static int countWaysRecursive(int n) { |
| 21 | if (n < 0) { |
| 22 | return 0; |
| 23 | } else if (n == 0) { |
| 24 | return 1; |
| 25 | } else { |
| 26 | return countWaysRecursive(n - 1) + countWaysRecursive(n - 2) + countWaysRecursive(n - 3); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | public static void main(String[] args) { |
| 31 | for (int i = 0; i < 30; i++) { |