1198. Substring
来源:互联网 发布:大宗期货软件 编辑:程序博客网 时间:2024/06/14 00:36
#include <cstdio>#include <iostream>#include <algorithm>#include <cstring>using namespace std;bool compare(string s1 , string s2){ return s1 + s2 < s2 + s1;}int main(){ int xxxxx; char ss[100]; scanf("%d" , &xxxxx); while (xxxxx) { --xxxxx; int n; scanf("%d" , &n); string a[10000]; for (int i = 0 ; i < n ; ++i) { scanf("%s" , ss); a[i] = ss; } sort(a , a + n , compare); for (int i = 0 ; i < n - 1 ; ++i) cout << a[i]; cout << a[n - 1] << "\n"; } return 0;}
本题经验总结:
1:string的深刻理解:可以加减,可以排序,可以出数组
2::有效利用algorithm里面的函数
- 1198. Substring
- 1198. Substring
- 1198. Substring
- 1198. Substring
- 1198. Substring
- 1198. Substring
- 1198. Substring
- 1198.Substring
- 1198. Substring --by rupeng
- Sicily 1198. Substring
- sicily--1198. Substring
- [sicily online]1198. Substring
- Sicily 1198. Substring
- 1198. Substring题解
- sicily 1198.Substring
- [sicily]1198. Substring
- Sicily 1198. Substring
- SOJ 1198. Substring
- Linux下常见文件解压方法及命令
- 子曾经曰过,不是想要轻言放弃,只是已经没有坚持下去的理由
- 博客迁移到 http://tarside.blog.163.com/ 了
- android widget之TextView
- POJ 3667 Hotel(成段更新,区间合并)
- 1198. Substring
- Button提交数据后失效的JS(数据提交中……)
- 取石子游戏(hdu 2516)
- 返回Winsock的版本信息
- LaTex 两种给公式加颜色的方法
- c++模板类如何定义模板成员函数
- 启动TCP Socket服务器
- IO完成端口入门级详细注释代码
- OO设计原则 -- Dependency Inversion Principle:OO设计的 DIP依赖倒置原则