从三个红球、五个白球、六个黑球中任意取出八个球,且须有白球,编程输出所有可能的方案。
#include <stdio.h>
int main()
{
int a, b, c;
for (b = 1; b<= 5; b++)
for (a = 0; a <= 3; a++)
for (c = 1; c <= 6; c++)
if (a + b + c ==8)
printf("红球的个数为=%d,白球的个数为=%d,黑球的个数为=%d\n", a, b, c);
return 0;
}