#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
stack<char> fo;
for(int i = 0; i<=sizeof(s); i++){
int a = int(s[i]);
cout<<a<<" ";
if(a == 41 || a == 93){
if(a-1 == int(fo.top()) || a-2 == int(fo.top())){
fo.pop();
}
}else{
fo.push(s[i]);
}
}
if(fo.empty()){
cout<<"OK";
}else{
cout<<"Wrong";
}
return 0;
}
在这个代码里,我的a值会变成负数,所以有没有哪位能帮帮我,说明一下(请详细点,谢谢)!