FDS10
FDS10
#include <stack>
#include <string>
stack<char> s;
s.push(ch);
s.pop();
return false;
}
}
return s.empty();
return true;
return false;
int main() {
string expression;
getline(cin, expression);
if (hasParentheses(expression)) {
if (isWellParenthesized(expression)) {
} else {
} else {
cout << "The expression does not contain any parentheses.\n";
return 0;
OUTPUT: