Python题解 | #记负均正II#
记负均正II
https://www.nowcoder.com/practice/64f6f222499c4c94b338e588592b6a62
import sys ans = 0 count = 0 arr = [] sum_ = 0 while True: try: n = int(input()) if n < 0: ans += 1 else: count += 1 sum_ += n except: break print(ans) if sum_ == 0: print(0.0) else: print("%.1f" % (sum_ / count))