C++使用棧解決括號匹配問題

#include<iostream> #include<stack> #include<string> using namespace std; bool Judge(string str) { //使用棧判斷括號匹配 stack <char>s; for (int i = 0; i < str.length(); i++) { switch (str[i]) { case '(
相關文章
相關標籤/搜索