Uva 10905 Children's Game
2016-04-24 23:12
274 查看
题意:给定n个正整数,求他们能拼接成的最大整数是多少。
白书诚不欺我,果然wa了好久....
白书诚不欺我,果然wa了好久....
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int n; string s[51]; bool camp(string a,string b) { return a + b > b + a; } int main() { cin.sync_with_stdio(false); while(cin>>n && n) { for(int i = 1;i <= n;i++) cin>>s[i]; sort(s+1,s+1+n,camp); for(int i = 1;i <= n;i++) cout<<s[i]; cout<<endl; } }
相关文章推荐
- [Perl] 常见signals解析
- 第3章第1节练习题1 蛇形矩阵
- c++作业4
- #include <NOIP2008 Junior> 双栈排序 ——using namespace wxl;
- 20159302《网络攻击与防范》第八周学习总结
- LeetCode 203
- c++ primer(第五版)学习笔记及习题答案代码版(第二章)
- 20145310《Java程序设计》第3次实验报告
- API 双方认证探讨
- PHP——图片上传
- LigerUI中通过加载服务端数据进行表格的分页显示
- sed命令解析
- 程序员怎么在短时间内从菜鸟到高级架构师
- LeetCode 202
- QT基础(三)----QPainter画图功能 & 画图小项目
- 数据库范式
- Win7下尝试编译Fast RCNN---- 一次失败的经历
- spark 性能优化
- Linux系统时间和硬件时间设置
- Swift爬坑记-CAKeyframeAnimation略解