Guest User

Untitled

a guest
Jan 12th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import Data.List
  2. main = do
  3. let bestTotal = total bestPrice
  4. putStrLn("Preis/stk: " ++ show (bestPrice/10))
  5. putStrLn("Abnahme: " ++ show (bestTotal/bestPrice))
  6. putStrLn("Gewinn: " ++ show (bestTotal/10))
  7.  
  8. bestPrice = foldl' better 10 [n*10,n*10-1..0]
  9. better a b = if (total a) < (total b) then b else a
  10. total price = price * (1000 + ((n*10-price) * 20))
  11. n = 10
Add Comment
Please, Sign In to add comment