class upsidedown {
public static void main(String args[]) {
int x, y;
for (y = 1; y <= 5; y++) {
for (x = 0; x < 5 - y; x++) {
System.out.print(' ');
}
for (x = (2 - y); x < (2 - y) + (2 * y - 1); x++) {
System.out.print('*');
}
System.out.print('\n');
}
}
}
到目前为止,我的代码打印出一个规则的、右侧向上的三角形。我怎么把它倒过来?