nyoj 2 括号匹配(栈的基本运用)

2015-01-27 10:12:10 · 作者: · 浏览: 12

括号配对问题

时间限制:3000 ms | 内存限制:65535 KB 难度:3
描述
现在,有一行括号序列,请你检查这行括号是否配对。
输入
第一行输入一个数N(0 输出
每组输入数据的输出占一行,如果该字符串中所含的括号是配对的,则输出Yes,如果不配对则输出No
样例输入
3
[(])
(])
([[]()])
样例输出
No
No
Yes
来源
网络
上传者
naonao 代码如下:
#include
      
       
#include
       
         char a[10010]; int main() { int n; scanf("%d",&n); while(n--) { int i,len,top=0; scanf("%s",a); len=strlen(a); for(i=1;i
        
         
<script type="text/java script">
<script type="text/java script">BAIDU_CLB_fillSlot("771048");
点击复制链接 与好友分享! 回本站首页
<script> function copyToClipBoard(){ var clipBoardContent=document.title + '\r\n' + document.location; clipBoardContent+='\r\n'; window.clipboardData.setData("Text",clipBoardContent); alert("恭喜您!复制成功"); }
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
您对本文章有什么意见或着疑问吗?请到 论坛讨论您的关注和建议是我们前行的参考和动力??
上一篇: CodeForces 398A Cards 贪心 暴力 瞎搞
下一篇: HDU 1428-漫步校园(记忆化搜索)
相关文章
<script type="text/java script">BAIDU_CLB_fillSlot("182716");
<script type="text/java script">BAIDU_CLB_fillSlot("517916");
图文推荐
<iframe src="http://www.2cto.com/uapi.php?tid=349671&catid=339&title=bnlvaiAyIMCousXGpcXko6jVu7XEu/mxvtTL08OjqQ==&forward=http://www.2cto.com/kf/201411/349671.html" width="100%" height="100%" id="comment_iframe" name="comment_iframe" frameborder="0" scrolling="no">
<script type="text/java script">BAIDU_CLB_fillSlot("771057");