prg10_3.cpp

来自「数据结构C++语言描术—清华大学出版的」· C++ 代码 · 共 28 行

CPP
28
字号
#include <iostream.h>
#pragma hdrstop

#include "comm.h"        // include the function comm

void main (void)
{
    int n, k;
    
    cout << "Enter # of candidates and # on a committee: ";
    cin >> n >> k;
    
    cout << "The # of possible committees is " 
         << comm(n,k) << endl;
}

/*
<Run #1 of Program 10.3>

Enter # of candidates and # on a committee: 10 4
The # of possible committees is 210

<Run #2 of Program 10.3>

Enter # of candidates and # on a committee: 9 0
The # of possible committees is 1
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?