If I recall, it's something like cout << " ##";
The ASCI for a space is 32 (decimal) I think.
Or is that c++?
I started with c or c++ in school, I forget. I used Turbo C++.
As far as the code is concerned, it looks simple to me. Each row above the bottom has (0+row) spaces. It looks like hte platform at the top is 2 characters in length. The width of the total pyramid can be estimated by (height+1). The number of blocks per row can be estimated by (width of the pyramid-spaces).
EDIT: I forgot about the role of printf in C.
You will probably want to loop printf(" "); to insert spaces on the line.
Insert pound signs the same way by looping printf("#"); and ending with printf("\n");
Honestly you just need to experiment with it.
|