2. A、B、C、D、E五名学生有可能参加计算机竞赛,根据下列条件判断哪些
人参加了竞赛:
(1)A参加时,B也参加;
(2)B和C只有一个人参加;
(3)C和D或者都参加,或者都不参加;
(4)D和E中至少有一个人参加;
(5)如果E参加,那么A和D也都参加。
// 入门必做题2.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
void mine(const int&a,const int&b,const int&c,const int&d,const int&e)
{
cout<<"去参加的人为"<<endl;
if (a==1)
{
cout<<"a"<<endl;
}
if (b==1)
{
cout<<"b"<<endl;
}
if (c==1)
{
cout<<"c"<<endl;
}
if (d==1)
{
cout<<"d"<<endl;
}
if (e==1)
{
cout<<"e"<<endl;
}
}
int main()
{
int a,b,c,d,e;
for(a=0;a<2;a++)
{
for(b=0;b<2;b++)
{
for(c=0;c<2;c++)
{
for(d=0;d<2;d+
2023


&spm=1001.2101.3001.11974&articleId=6549310&d=1&t=3&u=7b19a07d8d95455dbb66c2d3663d60ba)

被折叠的 条评论
为什么被折叠?



