/
nanezz
/
stl22
Обзор
Документация
Войти
/
nanezz
/
stl22
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
stl22.cpp
35 строк
765 B
nanezz
create: stl22.cpp, stl22.slnx
27 апр 2026, 21:49
Верифицирован
27 апр 2026, 21:49
c079cfd
Код
Авторство
О чём код?
#include <iostream> #include <vector> #include <list> #include <set> #include <string> template <typename Container> void print_container(const Container& c) { bool first = true; for (const auto& x : c) { if (!first) { std::cout << ", "; } std::cout << x; first = false; } std::cout << '\n'; } 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 EXIT_SUCCESS; }