Условие не совсем понятно, я решил, как понял лично я.
#include
#include
int main()
{
using namespace std;
//массив, представляющий рыбы в озере
string Fish[] = { "Sturgeon", "Trout", "Pink Salmon", "Herring",
"Cod", "Burbot", "Zander", "Bream", "Sea Bass" };
//массивы, представляющие рыбы, пойманные рыбаками
string Fisherman1[] = { "Burbot", "Bream", "Herring" };
string Fisherman2[] = { "Trout", "Burbot", "Sea Bass", "Herring", "Zander" };
string Fisherman3[] = { "Zander", "Pink Salmon", "Burbot", "Herring", "Trout" };
//количества элементов в массивах
int FishCount = sizeof(Fish) / sizeof(string);
int Fisherman1Count = sizeof(Fisherman1) / sizeof(string);
int Fisherman2Count = sizeof(Fisherman2) / sizeof(string);
int Fisherman3Count = sizeof(Fisherman3) / sizeof(string);
cout << "Fish caught by everyone:\n";<br> for (int i = 0; i < FishCount; ++i)
{
bool IsCaught = false;
for (int i1 = 0; i1 < Fisherman1Count; ++i1)
if (Fish[i] == Fisherman1[i1])
for (int i2 = 0; i2 < Fisherman2Count; ++i2)
if (Fish[i] == Fisherman2[i2])
for (int i3 = 0; i3 < Fisherman3Count; ++i3)
if (Fish[i] == Fisherman3[i3])
IsCaught = true;
if (IsCaught == true)
cout << Fish[i] << endl;<br> }
cout << endl;<br>
cout << "Fish in the lake, but didn't get caught:\n";<br> for (int i = 0; i < FishCount; ++i)
{
bool IsCaught = false;
for (int i1 = 0; i1 < Fisherman1Count; ++i1)
if (Fish[i] == Fisherman1[i1])
{
IsCaught = true;
break;
}
else
for (int i2 = 0; i2 < Fisherman2Count; ++i2)
if (Fish[i] == Fisherman2[i2])
{
IsCaught = true;
break;
}
else
for (int i3 = 0; i3 < Fisherman3Count; ++i3)
if (Fish[i] == Fisherman3[i3])
{
IsCaught = true;
break;
}
if (IsCaught == false)
cout << Fish[i] << endl;<br> }
cout << endl;<br> return 0;
}