import java.util.Scanner;
public class Test06 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入行数:");
int num = sc.nextInt();
for (int i = 1; i <= num; i++) {
for (int j = 1; j <= num - i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= 2 * i - 1; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |