This commit is contained in:
2026-03-15 20:40:00 +05:00
parent 06a34a1406
commit 775b21a9c4
5 changed files with 100 additions and 0 deletions

25
lr9/task_1/e3.java Normal file
View File

@@ -0,0 +1,25 @@
import java.util.Scanner;
class Main {
private static int step = 0;
public static void m(int x){
space();
System.out.println("" + x + "-> ");
step++;
if ((2 * x + 1) < 20){
m(2 * x + 1);
}
step--;
space();
System.out.println("" + x + " <-");
}
public static void space(){
for (int i = 0; i < step; i++){
System.out.println(" ");
}
}
public static void main(String[] args) {
m(1);
}
}