/ Vijos / 讨论 / 问答 /

求答案

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.

0 条评论

目前还没有评论...