Java :: Aufgabe #278 :: Lösung #4
4 Lösungen

#278
Das kleine Einmaleins
Anfänger - Java
von DragStar
- 06.04.2020 um 08:32 Uhr
Erstellen Sie ein Programm, welches das kleine Einmaleins in der Form
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 ...
.
.
.
10 20 30 40 50 60 70 80 90 100
ausgibt.
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 ...
.
.
.
10 20 30 40 50 60 70 80 90 100
ausgibt.
#4

von TheFirstLuc (280 Punkte)
- 29.04.2020 um 17:43 Uhr

public class num { public static void main(String args[]) { int[] width = new int[11]; int[] height = new int[11]; //occupy for(int i=0;i<width.length; i++) { width[i]=i; } for(int i=0;i<height.length; i++) { height[i]=i; } //calculate for(int i=1;i<height.length;i++) { for(int j=1;j<width.length;j++) { System.out.print(width[j]*height[i]+" "); if(j == 10) { System.out.println("\n"); } } } } }
Kommentare:
Für diese Lösung gibt es noch keinen Kommentar
Seite 1 von 0
1