#include <stdio.h> int main() { int n = 0; while (scanf("%d", &n) != EOF) { int i = 0; for (i = 1; i <= n; i++) { int o = 0; for (o = n; o>= i; o--)//输出前面空格 { printf(" "); } int p = 0; for (p = 1; p <= i; p++)//输出后面*号 { printf("*"); } printf("\n"); } int j = 0; for (j = 1; j <= n + 1; j++)//中间一行输出 { printf("*"); } printf("\n"); int k = 0; for (k = 1; k <= n; k++) { int g = 0; for (g = 1; g <= k; g++)//输出前面空格 { printf(" "); } int h = 0; for (h = n; h >= k; h--)//输出后面*号 { printf("*"); } printf("\n"); } } return 0; }