-8

我想创建一个函数来打印数字列表中的最大值。

4

1 回答 1

-1

我不知道python,但伪代码看起来像这样

max = –2147483648

for each integer n in collection
   if n > max
      max = n

它遍历集合中的每个数字。如果数字 (n) 大于前一个最大值,则将最大值设置为等于 n。

于 2014-10-05T01:18:40.010 回答