Originally Posted by
asexynerd
Adak can you give me a example of what you are saying because I am completely lost.
OK.
This is the figure with height = 8:
Code:
Height: 8
## row 1 has 2 #'s
### 2
#### 3
##### 4
###### 5
####### 6
######## 7
######### 8 has 9 #'s
Is that the right shape? I'm not that familiar with Mario!
So every row has 9 char's in it.
Code:
#include <stdio.h>
int main(void) {
int r, c, spaces;
int row,height;
int col;
printf("Enter height of the figure [1-23]: ");
//scanf("%d",&height);
printf("\n");
height = 8;
row=height;
col=row+1;
for(r=0;r<row+1;r++) {
for(c=0;c<col;c++) {
if(r>0) {
spaces = col-(r+1);
if(c<spaces)
printf("%c",' ');
else
printf("%c",'#');
}
}
if(r > 0)
printf(" row %d\n",r);
}
printf("\n");
return 0;
}