プログラミングのお題スレ Part18
(ID:eqKg5iqjのみ表示中)
戻る
679デフォルトの名無しさん [sage]

AAS

NG

haskell


import Data.List
import System.Random

trial records = do
x <- randomRIO (0, 1) :: IO Double
return $ (truncate $ x * 11) : records

experience = iterate (>>= trial) (return [0..10])
showrecord (x,y) = let
clsstr = id
$ reverse
$ take 2
$ ( ++ (repeat '0'))
$ reverse
$ show x
barstr = replicate y '*'
in concat [ clsstr," ", barstr,"\n"]

main = do
records <- experience !! 100
putStr $ id
$ concat
$ map showrecord
$ map (\x -> (head x, length $ tail x))
$ group
$ sort
$ records

2020/10/12(月)01:06:07.97(eqKg5iqj.net)


戻る
ver.151005sp