18 is greater than the average height

List of Topic Sets List of
Topics
Submitted List
Ranking
a total of 1875 points
Function questions
(a total of 110 points)
Programming questions
(a total of 1765 points)
Zhejiang University Edition "Python Programming" Topic Set
Announcement
Welcome to buy Zhejiang University Press Textbook-Zhejiang University Edition "Python Programming" , Reader verification code printed on the back of the book, can be used for this topic set. (During epidemic prevention and control, you can practice without reader verification code)

Download the electronic version of the first 2 chapters of the course here: Chapter 1, 2 of the "Python Programming" .pdf

Courseware for the first three chapters of the course can be downloaded here:

Chapter 0 Introduction to Python Programming Course.pptx

Chapter 1 Overview of Python Language.pptx

Chapter 2 Programs written in Python. Pptx

Back
Chapter 3-1 3-1. The average height (10 points)
for elementary and middle school students should be checked every semester, and the height should be measured, because height can reflect the child's growth status. Now that the height of a class has been measured, please output those 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 will output the input values ​​that exceed the average number of positive integers entered, with a space after each number, and the output order is the same as the input.

Input format:
The height value of a class in a line of input, separated by spaces.

Output format:
output the input value that exceeds the input average on one line, separated by spaces.

Sample input:
A set of inputs is given here. E.g:

143 174 119 127 117 164 110 128

Sample output:
The corresponding output is given here. E.g:

143 174 164

a=input().split()
a=list(a)
sum=0
for value in a:
    sum+=int(value)

sum=sum/len(a)

for values in a:
    if int(values) >= int(sum):
        print("%d " % int(values),end='')

exit(0)

Guess you like

Origin www.cnblogs.com/Alex3O/p/12701559.html