Kã³ã³ããã¼ã¿ã¨çå½å¤ã«é¢ãã話é¡ãæãã£ã¦ããã®ã§ãããã使ã£ã¦ä½ãæ¸ãã¦ã¿ããã¨æãã¾ããã æ¡ä»¶åå²ã¨è¨ãã° FizzBuzzã以ä¸ã®ãããªããã°ã©ã ãèãã¾ãã main = mapM putStrLn [ max (show n) $ fizz n ++ buzz n | n <- [1..100] ] fizz n = if mon n 3 == 0 then "Fizz" else "" buzz n = if mon n 5 == 0 then "Buzz" else "" ã¾ãã¯ä»¥ä¸ã®ããã« if' ãå®ç¾©ãã¾ãããããã ãã ã¨ã¾ã ãã¾ãå¤ãã£ã¦ãã¾ããã Haskell æ¨æºã® Bool åã使ã£ã¦ãããããã¿ã¼ã³ãããã§çµå± if ç¸å½ã®ãã¨ããã£ã¦ããããã§ããï¼ãã¤ã³ãããªã¼ã§æ¸ããªãï¼ï¼ï¼ fizz n = if' (mod n 3 == 0) "Fizz" "
{{#tags}}- {{label}}
{{/tags}}