Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Sudan-function/XPL0/sudan-function.xpl0
Normal file
24
Task/Sudan-function/XPL0/sudan-function.xpl0
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
func F; int N, X, Y;
|
||||
[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);
|
||||
];
|
||||
|
||||
int N, X, Y;
|
||||
[Format(4, 0);
|
||||
for N:= 0 to 1 do
|
||||
[Text(0, "Values of F("); IntOut(0, N); Text(0, ", X, Y):^m^j");
|
||||
Text(0, "Y/X 0 1 2 3 4 5^m^j");
|
||||
Text(0, "----------------------------^m^j");
|
||||
for Y:= 0 to 6 do
|
||||
[IntOut(0, Y); Text(0, " |");
|
||||
for X:= 0 to 5 do
|
||||
RlOut(0, float(F(N, X, Y)));
|
||||
CrLf(0);
|
||||
];
|
||||
CrLf(0);
|
||||
];
|
||||
Text(0, "F(2, 1, 1) = "); IntOut(0, F(2, 1, 1)); CrLf(0);
|
||||
Text(0, "F(3, 1, 1) = "); IntOut(0, F(3, 1, 1)); CrLf(0);
|
||||
Text(0, "F(2, 2, 1) = "); IntOut(0, F(2, 2, 1)); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue