***:下面是小编自己做的关于循环语句中的练习题
//用循环做出九九乘法表:
public static void main(String[] args) {
for (int j = 1; j < 10; j++) {for (int i = 1; i < 1 + j; i++) {
System.out.print(i + "*" + j + "=" + (i * j) + " ");
}
System.out.println();
}
public static void main(String[] args) {
for (int j = 0; j <= 5; j++) {
for (int i = 0; i <= j; i++) {
System.out.print("*");
}
System.out.println();
}
public static void main(String[] args) {
for (int j = 0; j < 5; j++) {
for (int i = 0; i < 5 - j; i++) {
System.out.print("*");
}
System.out.println();
}
public static void main(String[] args) {
for(int j = 0;j<5;j++){
for(int i = 4;i >= j;i--){
System.out.print(" ");
}
for(int i = 0;i <= 5;i++){
System.out.print("*");
}
System.out.println();
}
public static void main(String[] args) {
for(int j = 0;j < 5;j++){
for(int i = 0;i<10;i++){
if(j==0||j==4||i==0||i==9){
System.out.print("*");
}else{
System.out.print(" ");
}
}
System.out.println();
}