[恢]hdu 1267

2011-12-27 15:02:12

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1267

题意:中文。刚开始没看懂,注意“总”字。

代码:

# include <stdio.h>


long long dp[21][21] ;


int main ()
{
int i, j, m, n ;
for (i = 0 ; i <= 20 ; i++)
dp[0][i] = 1 ;
for (i = 1 ; i <= 20 ; i++)
for (j = i ; j <= 20 ; j++)
dp[i][j] = dp[i-1][j] + dp[i][j-1] ;
while (~scanf ("%d%d", &m, &n))
printf ("%I64d\n", dp[n][m]) ;
return 0 ;
}



posted @ 2012-01-06 23:56  Seraph2012  阅读(135)  评论(0编辑  收藏  举报