/
Puzzman
/
basic_programming
Обзор
Документация
Войти
/
Puzzman
/
basic_programming
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
cppl_homework_8_02/Main.cpp
29 строк
767 B
Puzzanis
homework added
30 ноя 2024, 09:29
30 ноя 2024, 09:29
5cf1c43
Код
Авторство
О чём код?
#include <iostream> #include<list> #include <set> #include <vector> template<class T> void printCont(const T& mass) { for (auto it = mass.begin(); it != mass.end(); it++) { std::cout << *it << '\t'; } std::cout << std::endl; } int main() { std::set<std::string> test_set = { "one", "two", "three", "four" }; printCont<std::set<std::string>>(test_set); // four one three two. помните почему такой порядок? :) std::list<std::string> test_list = { "one", "two", "three", "four" }; printCont<std::list<std::string>>(test_list); // one, two, three, four std::vector<std::string> test_vector = { "one", "two", "three", "four" }; printCont<std::vector<std::string>>(test_vector); // one, two, three, four return EXIT_SUCCESS; }