Multiplikationsmatrix, Seitenlaenge hinzugefügt

This commit is contained in:
Joel Baldauf
2020-11-27 10:26:24 +01:00
parent 0a35b374c5
commit 02bf60383e
2 changed files with 46 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import java.util.Scanner;
public class Seitenlaenge {
public static void main(String[] args) {
Scanner tastatur = new Scanner (System.in);
System.out.print("Seitenlänge >");
byte slaenge = tastatur.nextByte();
for (int i=0; i<slaenge; i++) {
if (i== 0 || i==slaenge-1) System.out.println("* ".repeat(slaenge));
else System.out.println("*"+" ".repeat(2*slaenge-3)+"*");
}
}
}