Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## 1. The rectangle
- 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.
- Example output for input `2`:
- ```
- ###
- ###
- ```
- Example output for input `3`:
- ```
- ###
- ###
- ###
- ```
- Example output for input `5`:
- ```
- ###
- ###
- ###
- ###
- ###
- ```
- ## 2. The simple tree
- Write program that takes user input and produces a tree from `*` as in examples below. The input should be a number.
- Example output for input `2`:
- ```
- *
- **
- ```
- Example output for input `3`:
- ```
- *
- **
- ***
- ```
- Example output for input `5`:
- ```
- *
- **
- ***
- ****
- *****
- ```
- ## 3. The symetric tree
- Write program that takes user input and produces a tree from `%` as in examples below. The input should be a number.
- Example output for input `2`:
- ```
- %
- %%%
- ```
- Example output for input `3`:
- ```
- %
- %%%
- %%%%%
- ```
- Example output for input `5`:
- ```
- %
- %%%
- %%%%%
- %%%%%%%
- %%%%%%%%%
- ```
- ## 4. The flexible rectangle
- Write program that takes 2 user inputs and produces rectangle of `@` with sides corresponding to user inputs. The inputs should be numbers.
- Example output for inputs `2` and `3`:
- ```
- @@@
- @@@
- ```
- Example output for inputs `4` and `6`:
- ```
- @@@@@@
- @@@@@@
- @@@@@@
- @@@@@@
- ```
- Example output for inputs `6` and `1`:
- ```
- @
- @
- @
- @
- @
- @
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement