Skip to content

Instantly share code, notes, and snippets.

@elderica
Created February 1, 2012 08:01
Show Gist options
  • Save elderica/1715881 to your computer and use it in GitHub Desktop.
Save elderica/1715881 to your computer and use it in GitHub Desktop.
手続き型言語Haskell
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