posts - 20,  comments - 6,  trackbacks - 0
 1#include<stdio.h>
 2#include<string.h>
 3 __int64 C(__int64 n, __int64 m)   
 4 {   
 5      __int64 i, j;   
 6      if (m > n/2) m = n - m;   
 7      for (i = 1, j = 1;i <= m; i++)   
 8      {   
 9      j = j * (n + 1 - i) / i;   
10      }
   
11      return j;   
12 }
   
13int main ()
14{
15  int i,j,t;
16  __int64 k1,k2,k;
17  __int64 m,n;
18
19  while(scanf("%I64d%I64d",&n,&m)!=EOF&&n||m)
20  {
21      t=m>n?n:m;
22      
23  printf("%I64d\n",C(m+n,t));
24  }

25  return 1;
26}

27
posted on 2009-01-27 14:04 混沌的云 阅读(121) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2009年1月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用链接

留言簿(1)

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜