11 lines
311 B
Text
11 lines
311 B
Text
procedure main()
|
|
write( if list_llt([1,2,1,3,2],[1,2,0,4,4,0,0,0]) then "true" else "false" )
|
|
end
|
|
|
|
|
|
procedure list_llt(L1,L2) #: returns L2 if L1 lexically lt L2 or fails
|
|
every i := 1 to min(*L1,*L2) do
|
|
if L1[i] << L2[i] then return L2
|
|
else if L1[i] >> L2[i] then fail
|
|
if *L1 < *L2 then return L2
|
|
end
|