NC25068. [USACO 2007 Mar L]Classroom Statistics
描述
输入描述
Line 1: A single integer: N
Lines 2..N+1: Line i+1 contains a single integer that is grade i for a cow.
输出描述
Line 1: A single line with a single integer
示例1
输入:
5 100 90 100 0 100
输出:
975
说明:
Five lines of input; four valid grades (#4 is invalid since it is 0)Python3 解法, 执行用时: 43ms, 内存消耗: 4556K, 提交时间: 2023-08-18 17:28:05
n, s, t = int(input()), 0, 0 for i in range(n): k = int(input()) if k > 0: t += 1 s += k print(int(s / t * 10 + 0.5))