Sum of first n cubes: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add Cowgol) |
m (→{{header|Haskell}}: Tidied) |
||
Line 855: | Line 855: | ||
Or, in terms of scanl: |
Or, in terms of scanl: |
||
<lang haskell>import |
<lang haskell>import Data.List (intercalate, scanl, transpose) |
||
import Data.List (intercalate, scanl, transpose) |
|||
import Data.List.Split (chunksOf) |
import Data.List.Split (chunksOf) |
||
import Text.Printf (printf) |
import Text.Printf (printf) |
||
Line 872: | Line 871: | ||
main :: IO () |
main :: IO () |
||
main = |
main = |
||
putStrLn $ |
(putStrLn . table " " . chunksOf 5) $ |
||
show <$> sumsOfFirstNCubes 50 |
|||
chunksOf 5 $ |
|||
show <$> sumsOfFirstNCubes 50 |
|||
------------------------- DISPLAY ------------------------ |
------------------------- DISPLAY ------------------------ |