http://acm.hdu.edu.cn/showproblem.php?pid=1106&&排序
来源:互联网 发布:php 序列化 编辑:程序博客网 时间:2024/06/03 14:34
尼玛坑爹的水题,得注意细节,,,,
#include<iostream>#include<string.h>#include<string>#include<set>using namespace std;int main(){string s;while(cin>>s){multiset<int>Q;int n=s.size();int i=0;string s1="\0";while(i<n){ if(s[i]!='5') s1+=s[i]; else if(s1.size()>0&&s[i]=='5')//当s1不为空时才处理{int b=atoi(s1.data());Q.insert(b); s1="\0";} i++;}if(s1.size()>0) {int b=atoi(s1.data());Q.insert(b);}multiset<int>::iterator it;cout<<*(Q.begin());for(it=++Q.begin();it!=Q.end();++it)cout<<" "<<*it; cout<<endl;}return 0;}
- http://acm.hdu.edu.cn/showproblem.php?pid=1106&&排序
- http://acm.hdu.edu.cn/showproblem.php?pid=1005
- http://acm.hdu.edu.cn/showproblem.php?pid=1333
- http://acm.hdu.edu.cn/showproblem.php?pid=2710
- http://acm.hdu.edu.cn/showproblem.php?pid=2866
- http://acm.hdu.edu.cn/showproblem.php?pid=1041
- http://acm.hdu.edu.cn/showproblem.php?pid=1719
- http://acm.hdu.edu.cn/showproblem.php?pid=2136
- http://acm.hdu.edu.cn/showproblem.php?pid=1166
- http://acm.hdu.edu.cn/showproblem.php?pid=3519
- http://acm.hdu.edu.cn/showproblem.php?pid=2446
- http://acm.hdu.edu.cn/showproblem.php?pid=1709
- http://acm.hdu.edu.cn/showproblem.php?pid=1874
- http://acm.hdu.edu.cn/showproblem.php?pid=1863
- http://acm.hdu.edu.cn/showproblem.php?pid=1879
- http://acm.hdu.edu.cn/showproblem.php?pid=1875
- http://acm.hdu.edu.cn/showproblem.php?pid=1102
- http://acm.hdu.edu.cn/showproblem.php?pid=1162
- JAVA 使用相对路径读取文件
- android 接入快盘 openapi 问题整理集合
- 为什么覆写equals的时候一定要覆写hashCode?
- String,StringBuffer与StringBuilder的区别
- Qt入门-基于QMainWindow的窗体
- http://acm.hdu.edu.cn/showproblem.php?pid=1106&&排序
- 如何实现类的成员函数作为回调函数
- VS2003下载地址
- Ubuntu 修改myeclipse背景色
- 指针
- webview可以获取网页源码,进行重新排版吗
- RegistryBooster 2012 and SpeedUpMyPC 2012
- 申请和释放堆内存
- ubuntu11.10 下编译 opencv2.4 所遇到的问题总结