fork download
  1. import Data.List
  2.  
  3. main :: IO ()
  4. main =
  5. let r = foldl' (\a _ ->
  6. a + foldl' (\acc x ->
  7. if x `mod` 2 == 0
  8. then acc + (sin $ fromIntegral x)
  9. else acc - (sin $ fromIntegral x)
  10. ) 0 [0..999999]
  11. ) 0 [0..99]
  12. in putStrLn $ show r
Success #stdin #stdout 0.16s 5760KB
stdin
Standard input is empty
stdout
15.772051598264591