Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## . - 1
- ### . - 2
- #### . - 3
- ##### - 4
- 1 - 2# 3""
- 2 - 3# 2""
- 3 - 4# 1""
- 4 - 5#
- H = 1
- # #
- H = 2
- _ # #
- # # #
- H = 3
- _ _ # #
- _ # # #
- # # # #
- H = 4
- _ _ _ # #
- _ _ # # #
- _ # # # #
- # # # # #
- 1 extra hashtag for every level
- #include <stdio.h>
- int main(void)
- {
- int number[5] = {1,2,3,4,5};
- char letters[5] = {'a','b','c','d','e'};
- for(int i = 0; i < 5; i++)
- {
- printf("%i -- %c", number[i], letters[i]);
- printf("\n");
- }
- }
- // get height
- // for loop
- // for everyline print HEIGHT + 1 number of characters
- // print out spaces for line
- // for loop
- // We always print out HEIGHT + 1 characters on everyline
- // Number of hashtags is current height and one more
- // If there are spaces, they decrease everyline
- // Last line has no spaces
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement