added halberTannenbaum

This commit is contained in:
Felitendo
2025-05-14 08:46:37 +02:00
parent 01b2b2e374
commit e62fb07969
2 changed files with 8 additions and 4 deletions

View File

@@ -2,6 +2,6 @@ package de.schleifen;
public class Main {
public static void main(String[] args) {
Schleifen.xEnZweiSchleife();
Schleifen.halberTannenbaum();
}
}

View File

@@ -11,13 +11,17 @@ public class Schleifen {
for (int i=0; i<6; i++) {
for (int j=0; j<5; j++) {
System.out.print("xx");
System.out.println("xx");
}
System.out.print("\n");
}
}
public static void halberTannenbaum() {
String x = "x";
for (int i=0; i<13; i++) {
String y = x + "x";
System.out.println(x);
x = y;
}
}
}