two_areas x y = area x + area y
     where area x = pi * square x
                where pi = 3.14
                      square x = x*x

area r = pi * r * r where pi = 3.1416
{- circumference r = 2*ppi*r -}

let_example = let x = 3 
                  f y = x+y
              in f x



k_from_n :: Int -> Int -> Int
k_from_n k n = fac n `div` (fac k * fac (n-k))
               where fac 0 = 1
                     fac n = n * fac (n-1)


is_zero :: Num(a) => a->Bool
is_zero x = x==0

max3 x y z | x >= y && y >= z = x
           | y >= x && y >= z = y
           | otherwise      = z

sum_the_list :: [Int]->Int
sum_the_list (x:xs) = x + sum_the_list xs
sum_the_list [] = 0

predecessor :: Int -> Int
predecessor 0 = 0
predecessor (n+1) = n

fac:: Int->Int
fac 0 = 1
fac n = n*fac (n-1)


{-fault_tolerant_fac::Int->String
fault_tolerant_fac n
   |n >= 0     = show(fac n)
   |otherwise  = ">>>: fac nicht definiert \n"++
                 "     fuer "++ (show n)-}


fault_tolerant_fac::Int->Int
fault_tolerant_fac n
   |n >= 0     = fac n
   |otherwise  = error (">>>: fac nicht definiert \n"++
                        "     fuer "++ (show n))


