#include<bits/stdc++.h>
#define ll long long
using namespace std;
string s1 , s2 ;
int x , cc ;
int main(){
cin >> s1 ;
while ( s1[cc] != '\0' ){
if ( s1[cc] == '(' ) {
cout << s1[cc] ;
s2[cc] = s1[cc] ;
x++ ;
}
if ( s1[cc] == ')' ) {
if ( x != 0 ) {
cout << s1[cc] ;
x-- ;
} else cout << "(" << s1[cc] ;
}
cc++ ;
}
while ( x != 0 ) {
cout << ")" ;
x-- ;
}
return 0;
}
这道题60分4个RE,哪里有问题?希望各位大神多多指点