/**
* @author bopomofo
* @create 2021-01-21 20:46
*/
public class Practice01 {
public static void main(String[] args) {
int x = 3;
while (x > 0) {
if (x > 2) {
// 最终结果为一行,所以全文使用print(print不换行,println换行)
System.out.print("a");
// x进行自减
x--;
System.out.print("-");
}
if (x == 2) {
System.out.print("b c");
x--;
System.out.print("-");
}
if (x == 1) {
System.out.println("d");
x--;
}
}
}
}