怎么样输出字符三角形的图?求教~~~~~~
java吧
全部回复
仅看楼主
level 10
cute皮卡丘 楼主
怎么样才能用数组来编写出能打印出来字符三角形图的?
图形就是这样的:
A
BBB
CCCCC
DDDDDDD
谢谢各位啦~~~~~~~
2011年07月20日 05点07分 1
level 9
一定要用数组么 = =
2011年07月20日 05点07分 2
level 10
cute皮卡丘 楼主
不用应该也行吧~
2011年07月25日 11点07分 3
level 1
For循环吧…
2011年07月25日 12点07分 4
level 7
public class Second{
public static void main(String args[]){
for(int i = 0; i < 4; i++){
for(int j = 0; j < 2*i+1; j++){
System.out.print((char)('A'+i));
}
System.out.println("\n");
}
}
}
2011年07月25日 13点07分 5
level 10
cute皮卡丘 楼主
回复5楼:
谢谢咯~~
2011年07月28日 06点07分 6
1