h_obby 2021-05-04 16:47 采纳率: 50%
浏览 1570
已采纳

python中输入N个数求最大值?

N=int(input())
max=0
for i in range(N):
    m=int(input())
    if m>max:
        max=m
if N<=0:
    print("ERROR")
else:
    print("max={}".format(max))
  • 写回答

3条回答 默认 最新

  • 关注
    N=int(input())
    max=0
    for i in range(N):
        m=int(input())
        if m>max:
            max=m
    if N<=0:
        print("ERROR")
    else:
        print("max={}".format(max))
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?