Auf Thema antworten

Wenn man int numberOfAnts von der Tastatur einlesen lässt, könnte man dann nicht beliebig viele Ameisen laufen lassen? Dein Programmstück berechnet ja gleich für beide Varianten die Koordinaten, das ist echt gut, das gefällt mir :D


[code=Java]

String FormatcoordA1 = "0", FormatcoordA2 = "0", FormatcoordB1 = "0", FormatcoordB2 = "0";

String Formatc_way1 = "0", Formatc_way2 = "0", Formatc_Distance = "0", Formatdistance_Ants = "0";

[/code]


kann man aber nicht einfach mit folgendem ersetzen, das mag der Compiler gar nicht:


[code=Java]

String Formatcoord1[1] = "0", Formatcoord2[1] = "0", Formatcoord1[3] = "0", Formatcoord2[3] = "0";

String Formatcoord1[5] = "0", Formatcoord2[5] = "0", Formatcoord1[6] = "0", Formatcoord2[6] = "0";

[/code]



Oben