摘要: #include <stdio.h>int main(){ int z; scanf("%d",&z); while(z--) { char ch,s[10001]; int top=-1; while((ch=getchar())!='\n')//中间没有空格 { if(ch==')' && top>=0 && s[top]=='(')//top>=0表明栈不空 top--; else if(ch==']' && top>= 阅读全文
posted @ 2012-05-16 13:11 加拿大小哥哥 阅读(395) 评论(0) 推荐(0)