Create Wuerfeln.java

This commit is contained in:
DerTyp187
2021-11-15 11:30:35 +01:00
parent 394d08d90d
commit c513e8a23c

View File

@@ -0,0 +1,27 @@
package zweidimnesionaleArrays;
import java.io.IOException;
public class Wuerfeln {
public static void main(String[] args) throws IOException {
int anzahlWuerfe = 10;
int anzahlExperimente = 4;
int[][] wuerfe = new int[anzahlExperimente][anzahlWuerfe];
for(int i = 0; i < anzahlExperimente; i++){
for(int a = 0; a < anzahlWuerfe; a++){
wuerfe[i][a] = (int)(Math.random()*6)+1;
}
}
for(int i = 0; i < anzahlExperimente; i++){
for(int a = 0; a < anzahlWuerfe; a++){
System.out.print(wuerfe[i][a] +" ");
}
System.out.print("\n");
}
}
}