HEU 2036 Paths on a Grid
生活随笔
收集整理的這篇文章主要介紹了
HEU 2036 Paths on a Grid
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?1/**//**************************************
?2Problem:?HEU?2036?Paths?on?a?Grid
?3Time:?0.0020?s
?4Memory:?256?k?
?5Accepted?Time:?2009-03-27?18:52:43
?6Tips:?求組合數,linux,long?long,%lld;windows,__int64,%I64d
?7**************************************/
?8#include?<stdio.h>
?9int?main()
10{
11????long?long?m,n;
12????long?long?res;
13????while(1)
14????{
15????????scanf("%lld%lld",&m,&n);
16????????if(m==0&&n==0)break;
17????????long?long?x=m<n?m:n;
18????????long?long?i,j;
19????????res=1;
20????????if(x!=m+n)
21????????for(i=1,j=m+n-x+1;i<=x;i++,j++)
22????????????res=res*j/i;
23????????printf("%lld\n",res);
24????}
25????return?0;
26}
27
?2Problem:?HEU?2036?Paths?on?a?Grid
?3Time:?0.0020?s
?4Memory:?256?k?
?5Accepted?Time:?2009-03-27?18:52:43
?6Tips:?求組合數,linux,long?long,%lld;windows,__int64,%I64d
?7**************************************/
?8#include?<stdio.h>
?9int?main()
10{
11????long?long?m,n;
12????long?long?res;
13????while(1)
14????{
15????????scanf("%lld%lld",&m,&n);
16????????if(m==0&&n==0)break;
17????????long?long?x=m<n?m:n;
18????????long?long?i,j;
19????????res=1;
20????????if(x!=m+n)
21????????for(i=1,j=m+n-x+1;i<=x;i++,j++)
22????????????res=res*j/i;
23????????printf("%lld\n",res);
24????}
25????return?0;
26}
27
轉載于:https://www.cnblogs.com/main/archive/2009/04/02/1427985.html
總結
以上是生活随笔為你收集整理的HEU 2036 Paths on a Grid的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JAVA使用FTPClient类读写FT
- 下一篇: ORACLE客户端与服务器连接