Advertisement
Guest User

najlepszy kurwa jego mac w pizde programik eeeee

a guest
Dec 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. main = do
  2. putStrLn ("Podaj liste L: ")
  3. input1 <- getLine // czyta stringa
  4. let l = (read input1 :: [Int]) //przeczyta ze stringa liste
  5. putStrLn ("Podaj liste M: ")
  6. input2 <- getLine
  7. let m = (read input2 :: [Int])
  8. let new_list = l ++ m
  9. let sum n = if null n
  10. then 0
  11. else (head n) + sum (tail n)
  12. let result1 = sum new_list
  13.  
  14. let mult n = if null n
  15. then 1
  16. else (head n) * mult (tail n)
  17. let result2 = mult new_list
  18.  
  19. putStrLn ("Suma: " ++ (show result1)) //zamieni liste znowu na stringa
  20. putStrLn ("Iloczyn: " ++ (show result2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement