list-processing

    2熱度

    2回答

    所以在Haskell的項目工作,我已經結束了寫下面的函數 reGrid :: [[[a]]] -> [[a]] reGrid [] = [] reGrid xs | any null xs = [] | otherwise = (concat $ map head xs) : reGrid (map tail xs) 對於那些誰也不說話哈斯克爾,這需要矩陣的名單,並加入相應的

    -1熱度

    2回答

    我需要創建一個算法,它將讀取列表A和B的用戶輸入,並確定列表B中的元素是否出現在列表A中(如果它們發生,程序需要打印'是',否則'打印')。 我想出了下面的代碼應該可以是一個起點: n=int(input('Enter the length of list A ')) A=[] for i in range (0,n): InpEl=int(input('Enter the elem