Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. ## 1. The rectangle
  2.  
  3. Write program that takes input from user and produces rectangle of `#` with height equal to user input and width equal to 3. The input should be a number.
  4.  
  5. Example output for input `2`:
  6. ```
  7. ###
  8. ###
  9. ```
  10.  
  11. Example output for input `3`:
  12. ```
  13. ###
  14. ###
  15. ###
  16. ```
  17.  
  18. Example output for input `5`:
  19. ```
  20. ###
  21. ###
  22. ###
  23. ###
  24. ###
  25. ```
  26.  
  27. ## 2. The simple tree
  28.  
  29. Write program that takes user input and produces a tree from `*` as in examples below. The input should be a number.
  30.  
  31. Example output for input `2`:
  32. ```
  33. *
  34. **
  35. ```
  36.  
  37. Example output for input `3`:
  38. ```
  39. *
  40. **
  41. ***
  42. ```
  43.  
  44. Example output for input `5`:
  45. ```
  46. *
  47. **
  48. ***
  49. ****
  50. *****
  51. ```
  52.  
  53. ## 3. The symetric tree
  54.  
  55. Write program that takes user input and produces a tree from `%` as in examples below. The input should be a number.
  56.  
  57. Example output for input `2`:
  58. ```
  59. %
  60. %%%
  61. ```
  62.  
  63. Example output for input `3`:
  64. ```
  65. %
  66. %%%
  67. %%%%%
  68. ```
  69.  
  70. Example output for input `5`:
  71. ```
  72. %
  73. %%%
  74. %%%%%
  75. %%%%%%%
  76. %%%%%%%%%
  77. ```
  78.  
  79. ## 4. The flexible rectangle
  80.  
  81. Write program that takes 2 user inputs and produces rectangle of `@` with sides corresponding to user inputs. The inputs should be numbers.
  82.  
  83. Example output for inputs `2` and `3`:
  84. ```
  85. @@@
  86. @@@
  87. ```
  88.  
  89. Example output for inputs `4` and `6`:
  90. ```
  91. @@@@@@
  92. @@@@@@
  93. @@@@@@
  94. @@@@@@
  95. ```
  96.  
  97. Example output for inputs `6` and `1`:
  98. ```
  99. @
  100. @
  101. @
  102. @
  103. @
  104. @
  105. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement