python怎么做啊,有没有大神

B2054 求平均年龄

luzhenyang0201 @ 2024-01-30 13:35:08

python怎么做啊,有没有大神


by bcdmwSjy @ 2024-01-30 13:44:37

一行代码,你值得拥有

print("%.2f"%(lambda a:sum(a)/len(a))(list(int(input()) for i in range(int(input())))))

by hexuchen @ 2024-01-30 13:45:38

@luzhenyang0201

n=int(input())
sum=0
for i in range(n):
    a=int(input())
    sum+=a
ans="{:.2f}".format(sum/n)
print(ans)

by NC20061226 @ 2024-01-30 13:59:53

n,s = int(input()),0
for i in range(n): s+=int(input())
print('%.2f'%(s/n))

蒟蒻的压码极限


by qwerfcxzasd @ 2024-04-05 10:46:56

厉害


|