题目: |
Var
n, m : Integer;
Function solve(n, m : Integer) : Integer;
Var i, sum : Integer;
Begin If m = 1 Then
Begin solve := 1;
Exit;
End;
sum := 0;
For i := 1 To n - 1 Do
sum := sum + solve(i, m - 1);
solve := sum;
End;
Begin Readln(n, m);
Writeln(solve(n, m));
End.
输入:7 4 输出:20
|