用for语句打印如下图形
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/11 20:51:01
用for语句打印如下图形
用java语言
![](http://img.wesiedu.com/upload/c/b5/cb578c2fa5bdc582c2660a2871f8f1ee.jpg)
用java语言
![](http://img.wesiedu.com/upload/c/b5/cb578c2fa5bdc582c2660a2871f8f1ee.jpg)
![用for语句打印如下图形](/uploads/image/z/1580847-15-7.jpg?t=%E7%94%A8for%E8%AF%AD%E5%8F%A5%E6%89%93%E5%8D%B0%E5%A6%82%E4%B8%8B%E5%9B%BE%E5%BD%A2)
public static void main(String[] args) {
for (int i = 1; i < 5; i++) {
for (int j = 4 - i; j > 0; j--) {
System.out.print(" ");
}
for (int j = 1; j = 1; j--) {
System.out.print((int) Math.pow(j, 2) + " ");
}
System.out.println("");
}
再问: 能详解吗??还是有点变化
再答: 不好意思 看错了.下面是正确的. public class Test { public static void main(String[] args) { for (int i =0; i < 5; i++) { for (int j = 4 - i; j > 0; j--) { System.out.print(" "); } for (int j = 0; j = 0; j--) { System.out.print((int) Math.pow(2,j) + " "); } System.out.println(""); } } }
for (int i = 1; i < 5; i++) {
for (int j = 4 - i; j > 0; j--) {
System.out.print(" ");
}
for (int j = 1; j = 1; j--) {
System.out.print((int) Math.pow(j, 2) + " ");
}
System.out.println("");
}
再问: 能详解吗??还是有点变化
再答: 不好意思 看错了.下面是正确的. public class Test { public static void main(String[] args) { for (int i =0; i < 5; i++) { for (int j = 4 - i; j > 0; j--) { System.out.print(" "); } for (int j = 0; j = 0; j--) { System.out.print((int) Math.pow(2,j) + " "); } System.out.println(""); } } }
用for语句打印如下图形
用java中的(for循环)打印如下三角形图形: ***** **** *** ** *
编写打印如下图形的程序 (必须用循环语句实现) * ** *** **** *****
打印如下图形 pascal
通过使用双重for循环语句,打印下列图形:
该怎样用打印语句打印下面图形:
请使用双重循环语句编写程序,打印出如下所示图形
21.用循环语句编写打印下列图形的程序.
用C语言的双重for循环语句怎么输出如下图形 * * * * * * * * * * * * * * * *
求大神用C#的for语句编写个图形,样子如下:
用C语言的双重for循环语句怎么输出如下图形
用循环语句编程,输出如下图形 * *** *** *