@Lokraan/

nae nae cookup

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Main {
  public static void main(String[] args) {
    System.out.println("Hello world!");

    System.out.println(m6(5, 3, 2));
    System.out.println(m7(5));
  }

  public static int m6(int n, int a, int d) {
    if(n == 1)
      return a;
    
    else
      return d + m6(n-1, a, d);
  }

  public static int m7(int n) {
    if(n < 0)
      return 2;
    else
      return m7(n - 1) + m7(n - 3);
  }
}