UVA 11988(p143)----Broken Keyboard
2016-02-27 13:54
423 查看
#include<iostream> #include<cstdio> #include<queue> #include<cstring> using namespace std; char st[100010]; int main() { while(scanf("%s",st)!=EOF) { int i=0; deque<int> q; int l=strlen(st); while(st[i]=='['||st[i]==']') i++; q.push_front(i); while(i<l) { if(st[i]=='[') { q.push_front(i+1); st[i]='\0'; } else if(st[i]==']') { q.push_back(i+1); st[i]='\0'; } i++; } while(!q.empty()) { printf("%s",st+q.front()); q.pop_front(); } printf("\n"); } return 0; }
相关文章推荐
- 迷人的hessian,你需要了解
- PhoneGap或者Cordova框架下实现Html5中JS调用Android原生代码
- 一个机器学习博客 ,包括 Standford公开课machine learning
- UVA 11971(p335)----Polygon
- 树莓派安装 python3 及 python IDE
- 数据结构算法之排序系列Java、C源码实现(3)--直接选择排序
- JavaScript高级程序设计(第3版)第四章读书笔记
- UVA 11925(p254)----Generating Permutations
- git push 出现untracked content
- Java的IO流
- bash
- csdn mysql 知识库,不错
- 1105. Spiral Matrix (25)
- UVA 11882(p218)----Biggest Number
- 3439: Kpm的MC密码 trie+主席树
- [UVA1587]BOX
- Apple Pay编程指导
- JSP学习笔记一之JSP的结构与生命周期
- UVA 11584(p275)----Partitioning by Palindromes
- 程序猿学习创业《第一期》