16 lines
322 B
Java
16 lines
322 B
Java
public class Recursion {
|
|
public static void main(String[] args) {
|
|
int x = 169;
|
|
int y = 2;
|
|
|
|
System.out.println(recurse(x, y));
|
|
|
|
}
|
|
public static int recurse(int x, int y) {
|
|
if (x < y) {
|
|
return x;
|
|
} else {
|
|
return recurse(x - y, y);
|
|
}
|
|
}
|
|
} |