这是很糟糕的代码,但它是有效的。我只是想知道这个递归调用如何判断哪个数字是最大的/max?试着像我7岁那样解释:)
fun badmax (xs : int list)=
if null xs
then 0
else if null (tl xs)
then hd xs
else if hd xs > badmax(tl xs)
then hd xs
else badmax(tl xs)
https://stackoverflow.com/questions/51798740
复制相似问题