М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации
Помрлтм245
Помрлтм245
12.12.2021 14:04 •  Информатика

Найдите пересечение и объединение следующих множеств: 1.A = {1, 5, 7, 14, 25}, B = {5, 9, 25, 37}

2.A = {1, 5, 7, 14, 25}, B = {4, 9, 37}

3.A = {1, 5, 7, 14, 25}, B = {5, 9, 25, 37}

4 A = {1, 5, 7, 14, 25}, B = {1, 5, 7, 14, 25}

5.A = {1, 5, 25}, B = { 5, 7, 14}​

👇
Ответ:
dsid2005
dsid2005
12.12.2021
Задание 1

A∩B = {5, 25}

A∪B = {1, 5, 7, 9, 14, 25, 37}

Задание 2

A∩B = {}

A∪B = {1, 4, 5, 7, 9, 14, 25, 37}

Задание 3

A∩B = {5, 25}

A∪B = {1, 5, 7, 9, 14, 25, 37}

Задание 4

A∩B = {1, 5, 7, 14, 25}

A∪B = {1, 5, 7, 14, 25}

Задание 5

A∩B = {5}

A∪B = {1, 5, 7, 14, 25}

4,6(67 оценок)
Открыть все ответы
Ответ:
JadenGirl
JadenGirl
12.12.2021

#include <iostream>

#include <vector>

#include <cmath>

using namespace std;

struct river{

   string name;

   double length;

   double depth;

   bool ships;

};

signed main(){

   int n;

   cin >> n;

   river a[n];

   for(int i = 0; i < n; i++)

       cin >> a[i].name >> a[i].length >> a[i].depth >> a[i].ships;

   vector<river> ans;

   for(auto i: a)

       if(i.length > 2 && i.ships)

           ans.push_back(i);

   for(auto i: ans){

       cout << "name: " << i.name << "\n";

       cout << "length: " << i.length << "\n";

       cout << "depth: " << i.depth << "\n";

       cout << "ships?: Yes";

   }

}

4,8(71 оценок)
Ответ:

#include <iostream>

#include <vector>

#include <cmath>

using namespace std;

struct river{

   string name;

   double length;

   double depth;

   bool ships;

};

signed main(){

   int n;

   cin >> n;

   river a[n];

   for(int i = 0; i < n; i++)

       cin >> a[i].name >> a[i].length >> a[i].depth >> a[i].ships;

   vector<river> ans;

   for(auto i: a)

       if(i.length > 2 && i.ships)

           ans.push_back(i);

   for(auto i: ans){

       cout << "name: " << i.name << "\n";

       cout << "length: " << i.length << "\n";

       cout << "depth: " << i.depth << "\n";

       cout << "ships?: Yes";

   }

}

4,6(50 оценок)
Это интересно:
Новые ответы от MOGZ: Информатика
Полный доступ к MOGZ
Живи умнее Безлимитный доступ к MOGZ Оформи подписку
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ