当前位置:编程学习 > C/C++ >>

poj1942

#include <iostream>   
#include <algorithm>   
  
using namespace std;  
  
#define ULL unsigned long long int   
  
int main()  
{  
    ULL a, b;  
    while (cin >> a >> b && (a || b))  
    {  
        if (b > a) swap(a, b);  
        ULL s = 1, i, j;  
        for (i = a + 1, j = 1; i <= a + b; i++, j++)  
        {  
            s = s * i / j;  
        }  
        cout << s << endl;  
    }  
}  

 

补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,