SHARE
TWEET

najlepszy kurwa jego mac w pizde programik eeeee

a guest Dec 10th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top