Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. ## . - 1
  2. ### . - 2
  3. #### . - 3
  4. ##### - 4
  5. 1 - 2# 3""
  6. 2 - 3# 2""
  7. 3 - 4# 1""
  8. 4 - 5#
  9.  
  10. H = 1
  11. # #
  12.  
  13. H = 2
  14. _ # #
  15. # # #
  16.  
  17.  
  18. H = 3
  19. _ _ # #
  20. _ # # #
  21. # # # #
  22.  
  23. H = 4
  24. _ _ _ # #
  25. _ _ # # #
  26. _ # # # #
  27. # # # # #
  28.  
  29.  
  30. 1 extra hashtag for every level
  31.  
  32. #include <stdio.h>
  33.  
  34. int main(void)
  35. {
  36. int number[5] = {1,2,3,4,5};
  37. char letters[5] = {'a','b','c','d','e'};
  38. for(int i = 0; i < 5; i++)
  39. {
  40. printf("%i -- %c", number[i], letters[i]);
  41. printf("\n");
  42. }
  43. }
  44.  
  45. // get height
  46. // for loop
  47. // for everyline print HEIGHT + 1 number of characters
  48. // print out spaces for line
  49. // for loop
  50.  
  51. // We always print out HEIGHT + 1 characters on everyline
  52. // Number of hashtags is current height and one more
  53. // If there are spaces, they decrease everyline
  54. // Last line has no spaces
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement