文章
3
粉丝
285
获赞
0
访问
27.2k
#include <bits/stdc++.h>
using namespace std;
int main() {
string s,ss;
while(cin>>s) {
ss=s;
cout<<s<<endl;
int len=s.length();
stack<char> s1;
stack<int> s2;
for (int i = 0; i < len; i++) {
if(s[i]=='('){
s1.push(s[i]);
s2.push(i);
} else if(s[i]==')'){
if(!s1.empty()&&s1.top()=='('){
s1.pop();
s2.pop();
 ...
登录后发布评论
暂无评论,来抢沙发