、#输入n个数输出其中的最大值n=intinput请输入数字的个数:for k in rangen x=floatinput请输入第个数:format【1】 #输入的提示内容为:请输入第1个数、请输入第2个数等 if 【2】 max=【3】 elif x【4】 【5】print输入的个数中最大值为:formatnmax
n=int(input("请输入数字的个数:")) max=float(input("请输入第1个数:")) for k in range(2,n+1): x=float(input("请输入第{}个数:".format(k))) if x>max: max=x print("输入的{}个数中最大值为:{}".format(n,max))
原文地址: http://www.cveoy.top/t/topic/hhlu 著作权归作者所有。请勿转载和采集!