#18291: C++ AC


pcsh_hlc (8=D short old two)

學校 : 新北市立板橋高級中學
編號 : 84470
來源 : [36.230.226.123]
最後登入時間 :
2024-05-12 02:26:10
d134. 00369 - Combinations -- UVa369 | From: [203.64.161.155] | 發表日期 : 2019-07-03 12:45

#include <iostream>
using namespace std;

int main(){

std::ios::sync_with_stdio(false);

unsigned long long n, m, c[101][101], i;
for (n = 0; n <= 100; n++){
c[n][0] = c[n][n] = 1;
for (m = 1; m < n; m++)
c[n][m] = c[n - 1][m] + c[n - 1][m - 1];

}
while (cin >> n >> m, n){
cout << n << " things taken " << m << " at a time is " << c[n][m] << " exactly." << endl;
}

}

 
ZeroJudge Forum