いろんな言語で宿題スレ
at TECH
501:デフォルトの名無しさん
09/07/17 22:26:05
>>492
import Control.Monad (foldM)
t492 :: Int -> IO (Int,Int)
t492 n = foldM f (maxBound :: Int,minBound :: Int) [1..n]
where
f (a,b) _ = do
s <- getLine
let n = read s
return (min a n, max b n)
main = getLine >>= t492 . read >>= print
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4630日前に更新/314 KB
担当:undef