2000OJ_sort
来源:互联网 发布:思维导图下载 mac 编辑:程序博客网 时间:2024/05/17 03:33
#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;struct E{ char name[100]; int age; int score; }buf[100]; bool cmp(E a,E b) { if(a.score!=b.score) { return a.score<b.score; } int temp=strcmp(a.name,b.name); if(temp!=0) { return temp<0; } else return a.age<b.age; } int main() { int n; while(scanf("%d",&n)!=EOF) { for(int i=0;i<n;i++) { scanf("%s%d%d",&buf[i].name,&buf[i].age,&buf[i].score); } sort(buf,buf+n,cmp); for(int i=0;i<n;i++) { printf("%s %d %d\n",buf[i].name,buf[i].age,buf[i].score); } return 0; } }
阅读全文
0 0
- 2000OJ_sort
- LeetCode OJ_Sort Colors
- 2000
- 2000
- 2000
- 2000
- 2000
- 2000
- 2000
- windows 2000
- ICIP 2000
- psp-2000
- 2000连接
- hd 2000
- 纪念2000
- JPEG 2000
- 2000年
- 2000以后
- *函数的调用——栈帧*
- 虚拟机中设置Linux网络为静态IP踩过的坑
- Android开发中出现Attempt to invoke virtual method...on a null object reference
- Redis简介(一)概述
- Error: No network specified. Cannot determine current network异常
- 2000OJ_sort
- 通过nginx访问.html出现Access Denied提示怎么解决
- tensorflow 实现 正规方程求解线性回归
- 上机练习题——异常处理(课堂练习1)
- mybatis学习笔记
- Markdown 添加 Latex 数学公式
- 最实用的Linux命令总结
- JAVA并发编程
- Cookie和Session详解