# 求最大值 def large(*num): # 定义一个large函数,函数的参数为可变参数 ma = num[0] # 初始化最大值 for n in num: if ma < n: # 对参数进行两两比较 ma = n # 对最大值重新赋值 return ma # 返回最大值 print(large(-234567, 1231, 345, 444, 199111, 0, -445666, 6666))…
python编写PAT甲级 1007 Maximum Subsequence Sum wenzongxiao1996 2019.4.3 题目 Given a sequence of K integers { N1, N2, ..., NK}. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj} where 1≤i≤j≤K. The Maximum Subsequence is the continuous sub…