/
AirLexa
/
04
Обзор
Документация
Войти
/
AirLexa
/
04
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Lesson_07/Task_2/Task_2.cpp
27 строк
700 B
AirLexa
dz STL 1-2
02 мар 2026, 18:56
Верифицирован
02 мар 2026, 18:56
ef6b736
Код
Авторство
О чём код?
#include <iostream> #include <vector> #include <set> #include <list> #include <algorithm> template<typename T> void print_container(T container) { std::cout << "container: "; std::for_each(container.begin(), container.end(), [](const auto& a) { std::cout << a << ' '; } ); std::cout << std::endl; } int main() { std::set<std::string> test_set = { "one", "two", "three", "four" }; print_container(test_set); std::list<std::string> test_list = { "one", "two", "three", "four" }; print_container(test_list); std::vector<std::string> test_vector = { "one", "two", "three", "four" }; print_container(test_vector); return 0; }