TOPIC
Compilation Error
bmonte asked 5 years ago
Tá dando compilation error e não consigo saber qual o problema.
#include <iostream>
#include <string>
#include <stack>
int main()
{
int max{0}, cont{0};
std::stack<char> pilha;
std::string line;
std::cin >> max;
std::cin.ignore();
for (auto i{0}; i < max; i++)
{
std::getline(std::cin, line);
for (auto &c : line)
{
if (c == '<')
pilha.push(c);
if (c == '>')
{
if (!pilha.empty())
{
pilha.pop();
cont++;
}
}
}
std::cout << cont << std::endl;
cont = 0;
}
return 0;
}