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

PROGRAMMING:Output all numbers greater than the average

Luz5年前 (2021-05-10)题库465
This problem requires programming, the input of N integers into the array a, and then calculate the average of these numbers, and then output all the numbers greater than the average.
###Input format:
Enter a positive integer n (1 ≤ n ≤ 10) in line 1 and N integers separated by spaces in line 2. The topic guarantees that the data does not exceed the range of long integers.
###Output format:
The output gives the average value on line 1, retaining 2 decimal places. In the second line, output all numbers greater than the average value, and there is a space after each number; If there is no number that satisfies the condition, an empty line is output.
If the input n is not in the valid range, output "invalid." in one line.
###Input sample 1:
```in
ten
55 23 8 11 22 89 0 -1 78 186
```
###Output sample 1:
The corresponding output is given here. For example:
```out
forty-seven point one zero
55 89 78 186
```
###Input sample 2:
```in
0
```
###Output sample 2:
The corresponding output is given here. For example:
```out
Invalid.
```







answer:If there is no answer, please comment