Run ID:160607
提交时间:2026-09-24 19:10:29
#include<stdio.h> int main() { int h; // 重点!循环读取多组输入,读到文件末尾结束! while(scanf("%d",&h)!=EOF) { int space = 2*(h-1); int star = h; for(int i=0;i<h;i++) { //打印空格 for(int j=0;j<space;j++) { printf(" "); } //打印星号 for(int j=0;j<star;j++) { printf("*"); } printf("\n"); space -= 2; star += 2; } } return 0; }