import java.util.Scanner;
class Test_Ling {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输出一个整数");
int x = sc.nextInt();
xx(x);
}
public static void xx(int y) {
for (int a=1;a<=y ;a++ ) {
for (int c=y-a;c>=0 ;c-- ) {
System.out.print(" ");
}
for (int b=1;b<=y ;b++ ) {
System.out.print("*"+" ");
}
System.out.println();
}
}
}
|
|