/* * exercise_1.hpp * * Created on: 6 окт. 2021 г. * Author: alexander */ #pragma once #include #include #include #include #include #include #include template void printWords(IT it, IT end) { std::unordered_set countWords(it, end); std::copy(countWords.begin(), countWords.end(), std::ostream_iterator(std::cout, "; ")); } void exercise_1() { std::vector v { "Один", "Два", "Три", "Пять", "Один", "Пять", "Шесть", "Два", "Два", "Один", "Семь", "Девять" }; std::cout << "Вывод вектора:" << std::endl; printWords(v.begin(), v.end()); std::list l(v.begin(), v.end()); std::cout << "\nВывод листа:" << std::endl; printWords(l.begin(), l.end()); std::deque d(v.begin(), v.end()); std::cout << "\nВывод деки:" << std::endl; printWords(d.begin(), d.end()); }