public class 排排看 {
public static void main(String[] args) {
int x = 3;
while (x > 0) {
if (x > 2) {
System.out.print("a");
// 打印到标准输出上
}
x = x - 1;
System.out.print("-");
if (x == 2) {
System.out.print("b c");
}
if (x == 1) {
System.out.print("d");
x = x - 1;
}
}
}
}
(String[] args)必须要传String的数组给此方法当参数,命名为args.