Auf Thema antworten

class MischMasch1 {

public static void main (String [] args) {


int x = 3;


if (x > 2) {

System.out.print ("a");

}


while (x > 0) {{


x = x - 1;

System.out.print ("-");


if (x == 2) {

System.out.print ("b c");

}


if (x == 1);{{

System.out.print ("d");

}}}


x = x - 1;}


}

}



Ich möchte gern die Ausgabe a-b c-d herausbekommen!


Was mache ich verkehrt?



Oben