Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
37
Task/Sudan-function/OxygenBasic/sudan-function.basic
Normal file
37
Task/Sudan-function/OxygenBasic/sudan-function.basic
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
uses console
|
||||
'
|
||||
function F(int n, x, y) as int
|
||||
if n = 0 then
|
||||
function = x + y
|
||||
exit function
|
||||
endif
|
||||
if y = 0 then
|
||||
function = x
|
||||
exit function
|
||||
endif
|
||||
function = F(n - 1, F(n, x, y - 1), F(n, x, y - 1) + y)
|
||||
end function
|
||||
'
|
||||
int n, x, y
|
||||
for n = 0 to 1
|
||||
printl " Values of F(" n ", x, y ):"
|
||||
printl " y/x 0 1 2 3 4 5"
|
||||
printl string(52, "-")
|
||||
for y = 0 to 6
|
||||
print " " y " |" tab
|
||||
for x = 0 to 5
|
||||
print F(n, x, y) tab
|
||||
next x
|
||||
printl
|
||||
next y
|
||||
printl
|
||||
next n
|
||||
'
|
||||
printl "F(0,0,0) = " F(0, 0, 0)
|
||||
printl "F(1,3,3) = " F(1, 3, 3)
|
||||
printl "F(2,1,1) = " F(2, 1, 1)
|
||||
printl "F(3,1,1) = " F(3, 1, 1)
|
||||
printl "F(2,2,1) = " F(2, 2, 1)
|
||||
|
||||
printl cr "Enter ..."
|
||||
waitkey
|
||||
Loading…
Add table
Add a link
Reference in a new issue