第1关:for循环的进阶使用-嵌套循环(1)
package step1;
public class ForPractice1 {
public static void test() {
/*****start*****/
for(int i=0;i<10;i++){
for ( int j= 0;j <10; j++){
System.out.print("*");
}
System.out.println();
}
/*****end*****/
}
}
第2关:for循环的进阶使用-嵌套循环(2)
package step2;
public class ForPractice2 {
public static void main(String[] args) {
/*****start*****/
for(int x=0;x<10;x++){for(int y=0;y<=x;y++){
System.out.print("*");
}
System.out.println();
}
System.out.println("——————————我是华丽的分界线——————————");//在这里打印出倒三角形
for(int x=10;x>0;x--){for(int y=x;y>0;y--){
System.out.print("*");
}
System.out.println();
}
/*****end*****/
}
}
第3关:99乘法表