Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.List
- main = do
- let bestTotal = total bestPrice
- putStrLn("Preis/stk: " ++ show (bestPrice/10))
- putStrLn("Abnahme: " ++ show (bestTotal/bestPrice))
- putStrLn("Gewinn: " ++ show (bestTotal/10))
- bestPrice = foldl' better 10 [n*10,n*10-1..0]
- better a b = if (total a) < (total b) then b else a
- total price = price * (1000 + ((n*10-price) * 20))
- n = 10
Add Comment
Please, Sign In to add comment