java简单程序打印这段英文怎么打印?

来源:百度知道 编辑:UC知道 时间:2024/06/06 03:19:01
A
BB
CCC
DDDD
EEEEE

用while循环实现,打印这个效果出来,怎么进行字符转换的?我初学,不要写太难的

你说只用while 循环实现对不?
这个绝对正确!

char i='a'; int num=1; int b=1;
while(b<=5){
while(num<=b){ System.out.print(i);
num++;
} System.out.print("\n");
b++;
i++;
num=1;
}

char o="A";int a=0;
while (a<24)
{
a++;
for(int b=0;b<a;b++)
System.out.println(o);
o++;
}

呵呵,都让上面的两个朋友回答了。

路过。用循环就行了。