Description of the parentheses matching problem currently, there is a sequence of parentheses. Please check whether this line of parentheses is paired. Enter N (0 <N <= 100) In the first line, indicating that N groups of test data exist. The next N rows Input Multiple groups of input data. Each group of input data is a string of S (the length of S is less than 10000, and S is not an empty string), and the number of test data groups is less than five. Data guarantee S only contains "[", "]", "(", ")" and outputs each group of input data to occupy one row, if the parentheses contained in the string are paired, Yes is output. If not paired, No is output. Input 3 [(]) ([[] ()]) sample output NoNoYes my program, using the language c ++. Idea: Import unmatched characters into the stack. If no matching character exists, the system outputs the stack. Check whether the stack is empty. The source code has been verified by the online system. SyntaxMatch. cpp [cpp] # include <iostream> # include <vector> using namespace std; int main (void) {int nLineNum = 0; cin> nLineNum; if (nLineNum <0 | nLineNum> 100) {cout <"Please input number 0 <n <= 100. "<endl; return 1 ;}vector <string> vInputList; for (int I = 0; I <nLineNum; ++ I) {string sInputStr = ""; cin> sInputStr; if (sInputStr. size () = 0) {cout <"Error: Input string is empty. "<endl; -- I; continue ;} If (sInputStr. size () & gt; = 10000) {cout <"Error: Input string is too long. "<endl; -- I; continue;} vInputList. push_back (sInputStr);} vector <string >:: iterator vIter = vInputList. begin (); for (; vIter! = VInputList. end (); ++ vIter) {string sUnMatch = ""; string sInput = * vIter; string: iterator sIter = sInput. begin (); for (; sIter! = SInput. end (); ++ sIter) {char cCurChar = * sIter; if (sUnMatch. empty () {sUnMatch. push_back (cCurChar);} else {string: iterator sEndIter = sUnMatch. end ()-1; char cEndChar = * sEndIter; if (cEndChar = '[' & cCurChar = ']') | (cEndChar = '(' & cCurChar = ') {sUnMatch. erase (sEndIter);} else {sUnMatch. push_back (cCurChar) ;}} if (sUnMatch. empty () {cout <"Yes" <endl ;}else {cout <"No" <endl ;}} return 1 ;}