- package zhengSanJiao;
- public class Demo1_Test {
- /**
- * @param args
- * 需求:打印一个正三角,五行五列
- * *
- * **
- * ***
- * ****
- * *****
- */
- public static void main(String[] args) {
- for (int x = 0; x <= 5; x++) {
- for (int y = 0; y < x; y++) {
- System.out.print("*");
- }
- System.out.println();
- }
- }
- }
复制代码 |
|