【发布时间】:2015-10-11 00:14:04
【问题描述】:
我必须在 Oz 中编写一个程序,该程序将返回列表中的最大整数。到目前为止,我的代码如下所示:
declare
proc {Max Xs K}
case Xs
of nil then K = 0
[] X|Xr then
local M in
if M < X then M = X end
{Max Xr K}
K = M
end
end
end
Mozart 环境将接受代码但不会返回答案。输入如下所示: {浏览{最大 [1 2]}}。我做错了什么?
【问题讨论】:
-
“Emacs 将接受代码”是什么意思?这个问题和 Emacs 有什么关系?