PROGRAMMING:The maximum span value of an integer sequence
###Task description
Given a nonnegative integer sequence of length N, calculate the maximum span of the sequence (maximum span = maximum minus minimum).
###Input format:
There are 2 lines in total. The number of the first line sequence is n (1 < = n < = 1000), and the number of the second line sequence is n non negative integers no more than 1000. The integers are separated by a space.
###Output format:
Output a line that represents the maximum span value of the sequence.
###Input example:
```in
six
3 0 8 7 5 9
```
###Output example:
```out
nine
```
###Title Source
Note: this topic is selected from openjudge website http://noi.openjudge.cn/ch0105/06/
###Problem analysis
First read the integer n, and then read n integers through N cycles.
Maximum span = maximum minus minimum. So the key of the problem is to find the maximum Max and minimum min in all sequences.
According to the description in the title, we know that the maximum value is not more than 1000 and the minimum value is not less than 1. This condition can help us set the initial values of the maximum value Max and the minimum value min.
answer:If there is no answer, please comment
Given a nonnegative integer sequence of length N, calculate the maximum span of the sequence (maximum span = maximum minus minimum).
###Input format:
There are 2 lines in total. The number of the first line sequence is n (1 < = n < = 1000), and the number of the second line sequence is n non negative integers no more than 1000. The integers are separated by a space.
###Output format:
Output a line that represents the maximum span value of the sequence.
###Input example:
```in
six
3 0 8 7 5 9
```
###Output example:
```out
nine
```
###Title Source
Note: this topic is selected from openjudge website http://noi.openjudge.cn/ch0105/06/
###Problem analysis
First read the integer n, and then read n integers through N cycles.
Maximum span = maximum minus minimum. So the key of the problem is to find the maximum Max and minimum min in all sequences.
According to the description in the title, we know that the maximum value is not more than 1000 and the minimum value is not less than 1. This condition can help us set the initial values of the maximum value Max and the minimum value min.
answer:If there is no answer, please comment