题目: |
var
n: longint;
function f(n, m: longint): longint;
begin
if (n = 0) or (m = 0) then
f := 0
else if (n = 1) or (m = 1) then
f := 1
else if n < m then
f := f(n, n)
else if n = m then
f := f(n, m-1)+1
else
f := f (n, m - 1) + f (n - m, m ) ;
end;
begin
readln(n);
writeln (f (n, n ) );
end.
输入:6 输出:11
|