11600 - 231001_10/12_practice4-2
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
Description
Let the user input an integer n > 0, followed by a “pattern”, represented by another integer.
There are three kinds of pattern:
If pattern is 1, print an inverted right triangle with the same number such as the first sample output.
If pattern is 2, print an inverted right triangle with reverse order such as the second sample output.
If pattern is neither 1 nor 2, your program should print the message such as the third sample output.
Input
Two integers, represent n and pattern respectively. These two integers is separated by a space.
Output
An inverted right triangle or the message. There is a new line after an inverted right triangle or the message.
Tags