#include <stdio.h> #include <stdlib.h> int main() { int i,n,j,m,a=0,b=1,c; scanf("%d",&n); for(i=1;i<=n;n--) { m = 2*n-1; a=a+1; for(j=1;j<=m;j++) { printf("#") ; } printf(" "); c=a; while(b<=c) {c--; printf(" "); } } return 0; }
#include <stdio.h> #include <stdlib.h> int main() { int i,n,j,m,a=0,b=1,c; scanf("%d",&n); for(i=1;i<=n;n--) { m = 2*n-1; a=a+1; for(j=1;j<=m;j++) { printf("#") ; } printf(" "); c=a; while(b<=c) {c--; printf(" "); } } return 0; }