/*
题目
口袋中有红,黄,蓝,白,黑5种颜色的求若干。每次从口袋中取出3个不同颜色的球,问有多少种取法
*/
#include <iostream>
using namespace std;
int main() {
int total=0;
for(int one=0;one<5;one++)
{
for(int two=0;two<5;two++)
{
if(one!=two)
{
for(int three=0;three<5;three++)
{
if((one!=three)&(two!=three))
{
total++;
}
}
}
}
}
cout<<total<<endl;
return 0;
}
习题1.3从五色球中取三色球的取法
最新推荐文章于 2023-02-28 11:24:56 发布