Haskell
æèèªç±ææ³(Context Free Grammar) 㨠解æ表ç¾ææ³(Parsing Expression Grammar) ã¯è¨æ³ãä¼¼ã¦ãããã®ã®ããã®æ§è³ªã¯å¤§ããç°ãªã£ã¦ããããããã以ä¸ã®ããã«Haskellã®ã¢ãããç¨ãã¦ãå·¦å帰çã§ãªãæèèªç±ææ³ããã®ã¾ã¾ãã¼ãµã¼ã³ã³ããã¼ã¿ã¼ã¨â¦
ããã©ã¯Haskellã§ãã£ã¦ã¿ãã solve :: Int -> [Int] -> Int -> Int solve price [] count = count solve price clist count | price >= (head clist) = solve (price - (head clist)) clist (count + 1) | otherwise = solve price (tail clist) count maâ¦
countSubstringSub :: String -> String -> Int -> Int countSubstringSub _ [] count = count + 1 countSubstringSub [] _ count = count countSubstringSub str sub count | (head str) == (head sub) = countSubstringSub (tail str) (tail sub) count | â¦