for(int a = 5; a > 0 ; a--){
for(int b = 1; b <= a; b++){
System.out.print(" ");
}
for(int c = 5; c >= a; c--){
System.out.print("* ");
}
System.out.println(" ");
}
for(int a = 4; a > 0 ; a--){
for(int d = 1; d > 0; d--){ //这行for循环只是为了排版用的,实际意义不大
System.out.print(" ");
}
for(int b = 4; b >= a; b--){
System.out.print(" ");
}
for(int c = 1; c <= a; c++){
System.out.print("* ");
}
System.out.println("");
}
相关文章
- 详解Python中的循环语句的用法
- 以下程序的功能是从键盘输入的一串字符中统计数字字符的个数,用换行符结束循环,利用for循环明确循环次数。引入#include库,使用strlen函数明确数字字符个数。例:abv123d45输出5
- while循环,格式化输出,运算符
- 记录我的 python 学习历程-Day02-while 循环/格式化输出/运算符/编码的初识
- while循环 格式化输出 密码本 编码的初识
- DAY2---Python---While循环,格式化输出,运算符,编码
- while循环,格式化输出,运算符及编码初识
- day02 python流程控制 while循环 格式化输出 运算符 编码
- python学习道路(day1note)(变量,注释,用户输入,格式化输出,if,while,for循环并扩展练习)
- springboot+mybatis-plus在log控制台输出sql语句的方法