Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/Sudan-function/FreeBASIC/sudan-function.basic
Normal file
25
Task/Sudan-function/FreeBASIC/sudan-function.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
Function F(n As Integer, x As Integer, y As Integer) As Integer
|
||||
If n = 0 Then Return x + y
|
||||
If y = 0 Then Return x
|
||||
Return F(n - 1, F(n, x, y - 1), F(n, x, y - 1) + y)
|
||||
End Function
|
||||
|
||||
Dim As Integer n, x, y
|
||||
For n = 0 To 1
|
||||
Print " Values of F(" & n & ", x, y):"
|
||||
Print " y/x 0 1 2 3 4 5"
|
||||
Print String(29, "-")
|
||||
For y = 0 To 6
|
||||
Print y; " |";
|
||||
For x = 0 To 5
|
||||
Print Using "####"; F(n,x,y);
|
||||
Next x
|
||||
Print
|
||||
Next y
|
||||
Print
|
||||
Next n
|
||||
|
||||
Print "F(2,1,1) ="; F(2,1,1)
|
||||
Print "F(3,1,1) ="; F(3,1,1)
|
||||
Print "F(2,2,1) ="; F(2,2,1)
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue