使用循环语句输出下面的图形。
#
for(int j = 1; j <= i; j++){
System.out.print("*");
}
public static void s(int a) {
String str = "#";
for (int i = 0; i < a; i++) {
if (i != 0) {
str += "##";
}
System.out.println(str);
}
}
for(int j=1;j<=4;j++){/*控制行*/
for(int i=1;i<=2*j-1;i++){/*控制列*/
System.out.print("# ");
}
System.out.println();
}
String str = "#"
for(int i=i;i<=4;i++){
System.out.print(str);
for(int j=1;j<2*i-1;j++){
str = str+"#"
}
}
亲测可用, 望采纳
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 2 * i - 1; j++)
System.out.print("#");
System.out.print("\n");
}