Greater than the average height

Primary and middle school students must have a physical examination every semester and their height should be measured, because height can reflect the growth status of their children. Now that the height of a class has been measured, please output the heights that exceed the average height. The input of the program is a line of data separated by spaces, and each data is a positive integer. The program should output those input values ​​that exceed the average number of the input positive integers, with a space after each number, and the output order is the same as the input.

Input format:

Enter the height value of a class in one line, separated by spaces.

Output format:

Output the input values ​​that exceed the average number of inputs on one line, separated by spaces.

Input sample:

Here is a set of inputs. For example:
143 174 119 127 117 164 110 128

Sample output:

The corresponding output is given here. E.g:

143 174 164

li=list(map(int,input().split()))
averge=sum(li)/len(li)
for i in li:
    if i > averge:
        print(i,end=' ')

Guess you like

Origin blog.csdn.net/m0_46407213/article/details/109154649