import java.util.Scanner;
public class Demo{
public static void main(String[] args){
//打印倒三角形
Scanner input = new Scanner(System.in);
System.out.print("请输入三角形的行数:");
int row = input.nextInt();
for(int i=row; i>0; i--){
for(int j=i; j>0; j--){
System.out.print("*");
}
System.out.print("\n");
}
}
}/*-------------------
请输入三角形的行数:6
******
*****
****
***
**
*-------------------*/
二重循环_打印倒三角形
最新推荐文章于 2022-12-31 11:56:11 发布