Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个函数来打印数字列表中的最大值。
我不知道python,但伪代码看起来像这样
max = –2147483648 for each integer n in collection if n > max max = n
它遍历集合中的每个数字。如果数字 (n) 大于前一个最大值,则将最大值设置为等于 n。