HDU 2115 I Love This Game
来源:互联网 发布:java 网络框架 编辑:程序博客网 时间:2024/05/21 18:49
格式很坑
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <string>using namespace std;struct hui{ int time; char name[100]; int rank;}s[11];bool cmp(hui a,hui b){ if(a.time!=b.time)return a.time<b.time; else return strcmp(a.name,b.name)<0;}int main(){ int n;// freopen("in.txt","r",stdin); int cas=1; while(cin>>n&&n) { int t1,t2; for(int i=0;i<n;i++) { scanf("%s",s[i].name); scanf("%d:%d",&t1,&t2); s[i].time=t1*60+t2; } sort(s,s+n,cmp); int flag; s[0].rank=flag=1; for(int i=1;i<n;i++) { if(s[i].time==s[i-1].time)s[i].rank=flag; else flag=s[i].rank=i+1; } if(cas>1)printf("\n"); printf("Case #%d\n",cas++); for(int i=0;i<n;i++) { cout<<s[i].name<<" "<<s[i].rank<<endl; } } return 0;}
0 0
- hdu 2115 I Love This Game
- HDU 2115 I Love This Game
- HDU 2115 I Love This Game
- hdu 2115 I Love This Game
- hdu 2115 I Love This Game
- I Love This Game hdu 2115
- HDU 2115 I Love This Game
- hdu 2115 I Love This Game
- HDU--2115 I Love This Game
- hdu 2115 I Love This Game
- hdu-2115-I Love This Game
- hdu 2115 I Love This Game
- HDU 2115 I Love This Game
- I Love This Game 2115
- hdu-2115(结构体,sort) I Love This Game
- HDOJ(HDU) 2115 I Love This Game(排序排序、、、)
- HDU,2215,I Love This Game
- I Love This Game!
- 小米手机会不会更好
- C语言大牛的心得
- mysql-The server quit without update PID file
- Linux 修改用户密码 lsattr chattr 小记
- png-8 和 png-24的区别
- HDU 2115 I Love This Game
- 设计模式之访问者模式(Visitor)摘录
- EC2菜鸟入门日记之一(登陆与验货)
- Eclipse下编写C++程序——CDT环境搭建
- 从上往下打印二叉树(面试题 23)
- linux学习笔记1
- <<Python编程实践>>之Choose
- 腾讯应用中的轩辕诀这款游戏好玩不?轩辕诀游戏介绍
- leetcode: String to Integer (atoi)