online_judge_1130
2015-12-21 18:09
211 查看
#include <iostream> #include <string> #include <sstream> #include <algorithm> using namespace std; struct LOG { string str; string name; string date; string time; string second; bool operator < (const LOG & A) const { if(second != A.second) { if(second.size() != A.second.size()) return second.size() < A.second.size(); return second < A.second; } if(date != A.date) return date < A.date; if(time != A.time) return time < A.time; return true; } }L[10001]; int main() { int i,cnt=0; while(getline(cin, L[cnt].str)) { if(L[cnt].str == "") break; istringstream is(L[cnt].str); is>>L[cnt].name>>L[cnt].date>>L[cnt].time>>L[cnt].second; cnt++; } sort(L, L+cnt); for(i=0; i<cnt; ++i) cout<<L[i].str<<endl; return 0; }
清华的机试排序题。。说起排序题,,浙大的题目才是经典……
相关文章推荐
- Android Activity通过Intent传递数据
- Metasploit 笔记
- Package has no installation candidate解决方法
- 指针常量和常量指针
- UCOS移植LWIP
- Linux C 函数指针应用---回调函数
- ACboy needs your help again!(杭电1702)(栈和队列的基础应用)
- 再谈strncpy函数--值得一看的好文章
- C语言中的文件操作
- Linux系统机器卡在主系统读条界面
- HTML5基础标签与SEO
- Linq to Excel绑定对象的实现
- 穷孩子没有春天?——寒门子弟为何离一线高校越来越远
- 博客园插入代码格式的一点小bug
- Maven 的41种骨架
- Canvas 刮刮乐
- spring报“Could not resolve placeholder”错误,解决方案
- 使用刚体后,物体抖动(爬坑向)
- dozer-初识
- OC登陆界面登陆按钮动画