-->
当前位置:首页 > 题库

PROGRAMMING:Solving the right most value problem

Luz5年前 (2021-05-10)题库423
Given n (no more than 20) elements, this problem solves the right most value problem. The so-called "right most value" refers to an element in a sequence whose value is larger than that of all the elements after it, then the element is called the right most value element. For example, the rightmost elements of sequence 10, 9, 5, 13, 2, 7, 1, 8, 4, 6, 3 are 13, 8, 6, 3.
###Input format:
Input the number of elements in the first line;
On the second line, enter the corresponding element.
###Output format:
Output all rightmost elements, separated by a space, and finally a space.
###Input example:
```in
eleven
10 9 5 13 2 7 1 8 4 6 3
```
###Output example:
```out
13 8 6 3
```







answer:If there is no answer, please comment