PROGRAMMING:Finding the maximum of N numbers
The user first enters a positive integer n (n is not more than 10), which means that n integers (all int type) will be entered next. Please find out the maximum value among these n integers.
###Input format:
Input as a line, the first is a positive integer n, and then n integers.
###Output format:
The output is an integer representing the maximum of N integers.
###Input sample 1:
```in
4 2 123 -100 0
```
###Output sample 1:
```out
one hundred and twenty-three
```
###Input sample 2:
```in
3 -9 -18 -28
```
###Output sample 2:
```out
-9
```
answer:If there is no answer, please comment
There are two difficulties in this problem: one is how to get all the data correctly, the other is how to find the maximum value< br>
The key to find the maximum or minimum value: set the first number to be compared to the temporary maximum value max, then read a number and compare it with max. if the number read is larger than max, update max. It can be found that Max is always the maximum value in the finished data< br>
You can first read in N and the first number Max to participate in the comparison, then loop n-1 times, read a number, compare with Max once, and update if necessary. Think about it. Why only recycle n-1 times?
###Input format:
Input as a line, the first is a positive integer n, and then n integers.
###Output format:
The output is an integer representing the maximum of N integers.
###Input sample 1:
```in
4 2 123 -100 0
```
###Output sample 1:
```out
one hundred and twenty-three
```
###Input sample 2:
```in
3 -9 -18 -28
```
###Output sample 2:
```out
-9
```
answer:If there is no answer, please comment
There are two difficulties in this problem: one is how to get all the data correctly, the other is how to find the maximum value< br>
The key to find the maximum or minimum value: set the first number to be compared to the temporary maximum value max, then read a number and compare it with max. if the number read is larger than max, update max. It can be found that Max is always the maximum value in the finished data< br>
You can first read in N and the first number Max to participate in the comparison, then loop n-1 times, read a number, compare with Max once, and update if necessary. Think about it. Why only recycle n-1 times?