博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
B1004. 成绩排名
阅读量:4690 次
发布时间:2019-06-09

本文共 566 字,大约阅读时间需要 1 分钟。

这一题总算是把C++的重载活学活用了一回,节省了很多脑细胞。

#include
using namespace std;struct student{ string name; string code; int score; //operator < bool operator < (const student& b){ return this->score
students;void solve(){ int n; cin>>n; while(n--){ student s; cin>>s.name>>s.code>>s.score; students.push_back(s); } sort(students.begin(),students.end()); cout<
<<" "<
<

sort一把梭,用vector存结构体,非常省事。

转载于:https://www.cnblogs.com/MarkKobs-blog/p/10550423.html

你可能感兴趣的文章
以太坊挖矿源码:clique算法
查看>>
2010年的20款游戏
查看>>
传媒业进入B2C领域:香港商报推爱购商城
查看>>
jquery ajax jsonp跨域调用实例代码
查看>>
poj 2965
查看>>
POJ 3349 Snowflake Snow Snowflakes
查看>>
Beta阶段冲刺四
查看>>
使用maven给spring项目打可直接运行的jar包(配置文件内置外置的打法)
查看>>
第十八周作业
查看>>
woff字体找不到导致的404错误
查看>>
Divisibility题解
查看>>
C语言 SDK编程之通用控件的使用--ListView
查看>>
C语言程序设计第四次作业——选择结构(2)
查看>>
Deepin下安装搭建latex编写环境
查看>>
centos7上安装phpcms
查看>>
TV TimeShift和PVR的区别
查看>>
字节流的示例代码
查看>>
类似于抽奖活动的小程序
查看>>
使用终端shell命令批量改动一个文件下的全部文件的读写权限
查看>>
Mysql net start mysql启动,提示发生系统错误 5 拒绝訪问 解决之道
查看>>