4 条题解
-
2
#include<bits/stdc++.h> using namespace std; string str; stacks; int main(){ cin>>str; for(int i=0;i<str.size();i++){ if(str[i]']'){ if(s.empty()||s.top()!='['){ cout<<"Wrong"; } else s.pop(); } else if(str[i]')'){ if(s.empty()||s.top()!='('){ cout<<"Wrong"; } else s.pop(); } else s.push(str[i]); } if(s.size()==0){ cout<<"OK"; } else cout<<"Wrong"; return 0; }
信息
- ID
- 1518
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 7
- 标签
- (无)
- 递交数
- 402
- 已通过
- 107
- 上传者