Ответ:
#include <iostream>
#include <string>
int main()
{
int i, j, k, length;
std::string s;
std::cin >> s;
length = s.length();
for (int i = 0; i < length; i++)
j = i;
k = 0;
if (s[i] == '<')
do k++;
while (s[j++] != '>');
}
if (k != 0)
s.erase(i, k);
length -= k;
i--;
std::cout << s;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
#include <string>
int main()
{
int i, j, k, length;
std::string s;
std::cin >> s;
length = s.length();
for (int i = 0; i < length; i++)
{
j = i;
k = 0;
if (s[i] == '<')
{
do k++;
while (s[j++] != '>');
}
if (k != 0)
{
s.erase(i, k);
length -= k;
i--;
}
}
std::cout << s;
return 0;
}