这道题,要完成之前,我买先来看下程序清单7.4的问题:获奖的概率
问题跑出来了。下面我们看这个问题的解决办法。
#pragma region calling.cpp 7.4
/*
*/
#if 1
#include <iostream>
// Note: some implementations require double instead of long double
long double probability(unsigned numbers, unsigned picks);
int main()
{
using namespace std;
double total, choices;
cout << "Enter the total number of choices on the game card and\n"
"the number of picks allowed:\n";
while ((cin >> total >> choices) && choices <= total)
{
cout