#include #include #include class TagRemover { private: std::string content; public: TagRemover(std::istream& input) { std::string line; while (std::getline(input, line)) { content += line + '\n'; } } void print(std::ostream& output) const { std::string result = std::regex_replace(content, std::regex("<[^>]*>"), ""); result = std::regex_replace(result, std::regex("<"), "<"); result = std::regex_replace(result, std::regex(">"), ">"); result = std::regex_replace(result, std::regex(" "), " "); result = std::regex_replace(result, std::regex("&"), "&"); output << result; } }; int main() { TagRemover tr(std::cin); tr.print(std::cout); return 0; }