#include <stdio.h> int main() { int a; while (scanf("%d", &a) != EOF) { int i; for (i = 0; i < a; i++) { //行数 int j, k;//空格和* for (j = 0; j < a - 1 - i; j++)//先打印每行左边空格 printf(" "); for (k = 0; k <= i; k++)//再打印* printf("* "); printf("\n"); } } return 0; }