L
Luca2
Gast
Hallo
Ich bin totaler anfänger in Java und möchte desbezogen auch nicht die Lösung, sondern eher tipps. Mein Problem ist, dass ich am Schluss die Array 10 10 abfrage und die 0 ist wie auch alle anderen...warum geht das nicht?
Mein code:
Ich bin totaler anfänger in Java und möchte desbezogen auch nicht die Lösung, sondern eher tipps. Mein Problem ist, dass ich am Schluss die Array 10 10 abfrage und die 0 ist wie auch alle anderen...warum geht das nicht?
Mein code:
Java:
package tutorial;
import java.util.Scanner;
public class zufaellige_zahl_richtig
{
public static void main(String[] args)
{
//System.out.println((int) (1 + Math.random()*10));
int loesung[][]=new int [11][11];
int zahl1=1;
int zahl2=1;
int zahl3=1;
do
{
while (zahl1!=11)
{
loesung[zahl2][zahl3] = (zahl2*zahl3);
zahl2++;
zahl1++;
}
zahl1=1;
zahl2=0;
zahl3++;
System.out.println(loesung[1][1]);
} while (loesung[10][10]!=100);
System.out.println(loesung[10][10]);
}
}