Subject description:
Enter a height h, the output of a height is h, h, on the base of the trapezoid
Sample input:
4
Sample output:
****
******
********
**********
#include<stdio.h> int main() { int h; while(scanf("%d",&h)!=EOF) { int max=h+(h-1)*2; for(int i=1;i<=h;i++) { for(int j=1;j<=max;j++) { if(j<max-h-(i-1)*2+1) { printf(" "); } else { printf("*"); } } printf("\n"); } } return 0; }