Java流程控制练习
练习
- 打印三角形及Debug的使用
public class TestDemo {
public static void main(String[] args) {
//打印三角形 5行
for(int i = 1; i <= 5; i++){
for (int j = 5; j >= i; j--){
System.out.print(" ");
}
for (int j = 1;j<= i; j++){
System.out.print("*");
}
for (int j = 1; j < i; j++){
System.out.print("*");
}
System.out.println();
}
}
}
*
***
*****
*******
*********
一个人若逃避他所惧怕的事情,最终会发现他只不过是走了一条更快遇到恐惧的路。
@侧耳听智慧,专心求聪明 Turnging your ear to wisdom and applying your heart to understanding!

浙公网安备 33010602011771号