Jump to content

Sum of first n cubes: Difference between revisions

m
(Add Cowgol)
Line 855:
 
Or, in terms of scanl:
<lang haskell>import ControlData.MonadList (joinintercalate, scanl, transpose)
import Data.List (intercalate, scanl, transpose)
import Data.List.Split (chunksOf)
import Text.Printf (printf)
Line 872 ⟶ 871:
main :: IO ()
main =
(putStrLn . table " " . chunksOf 5) $
tableshow "<$> "sumsOfFirstNCubes $50
chunksOf 5 $
show <$> sumsOfFirstNCubes 50
 
------------------------- DISPLAY ------------------------
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.