Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
11
Task/Sudan-function/Miranda/sudan-function.miranda
Normal file
11
Task/Sudan-function/Miranda/sudan-function.miranda
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
main :: [sys_message]
|
||||
main = [Stdout (lay (map test tests))]
|
||||
where test (n,x,y) = "F" ++ show n ++ "(" ++ show x ++ ","
|
||||
++ show y ++ ") = " ++ show (f n x y)
|
||||
tests = [(0,0,0), (1,1,1), (1,3,3),
|
||||
(2,1,1), (2,2,1), (3,1,1)]
|
||||
|
||||
f :: num->num->num->num
|
||||
f 0 x y = x+y
|
||||
f (n+1) x 0 = x, if n >= 0
|
||||
f (n+1) x (y+1) = f n k (k + y + 1), if n >= 0 where k = f (n+1) x y
|
||||
Loading…
Add table
Add a link
Reference in a new issue