printf("*"); if (i==n-1) //若为最后一行,则结束循环 { printf("\n"); break; } for (j=0;j<2*n-3-2*i;j++) //打印行中空心部分的空格 printf(" ")
include <stdio.h> void main(){ int h,i,j;do { printf("input the triangle's height h:\n");scanf("%d",&h);if(h<0){ printf("input height error!\ninput again:\n");scanf("%d",&h);} }while(h<0);for(i=0;i<h;i++){ if(i==0){ for(j=0;j<2*h-1;j...