Created
February 1, 2012 08:01
-
-
Save elderica/1715881 to your computer and use it in GitHub Desktop.
手続き型言語Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (forM_) | |
import Data.Functor ((<$>)) | |
main = do | |
putStrLn "input natural number" | |
n <- read <$> getLine | |
putChar '\n' | |
forM_ [n, n-1 .. 1] $ \i -> do | |
forM_ [i, i-1 .. 1] $ \j -> do | |
putStr $ show j | |
putChar '\n' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment