- 11 名前:a36 ◆K0BqlCB3.k [2009/05/23(土) 03:51:35 ]
- module Main(main) where
import Data.Char import Control.Monad import Data.List main = do { str <- getLine ; let xss = fun38 . map digitToInt $ str ; display xss ; putStr "last = " ; putChar . intToDigit . head . last $ xss } fun38 [] = [] fun38 xs = xs : fun38 (zipWith (\a b -> (a + b) `mod` 10) xs (tail xs)) display = zipWithM ((putStrLn .) . (. (intersperse ' ' . map intToDigit)) . (++) . flip replicate ' ') [0..]
|

|