求标准答案,另外我这个是对的吗?

来源:5-3 编程练习

慕妹5486910

2020-03-13 16:52:50

public class StarDemo {

    public static void main(String[] args) {

// 输出星号组成的梯形

for(int i=1; i<=5; i++){

    for(int j=1; j<=7+i;j++){

        if(5- j -i >= 0){

        System.out.print("  ");

        }else{

            System.out.print("* ");

        }

    }

    System.out.println();

}

}

}



写回答

1回答

好帮手慕小脸

2020-03-13

同学你好,测试代码运行效果已经展示出来。继续加油!

并没有固定的标准答案,同学可参考其他同学的想法:

https://class.imooc.com/course/qadetail/194509

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~


0

0 学习 · 11489 问题

查看课程