题解 2916: 谁考了第k名

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

谁考了第k名 C++

```cpp#includeusingnamespacestd;//定义学生结构体structStudent{intid;//学号floatscore;//成绩};//自定义比较函数,根据score字段比较学生记录boolcompare(constStudent&a,

谁考了第k名c++

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; struct Student{     int id;     double ……

2916: 谁考了第k名

```cpp#includeusingnamespacestd;structs{intxuehao;doublechengji;};intmain(){sppp[101];intn,k;cin>>n>>k;for(inti=1;i>ppp[i].xuehao>>ppp[i].chengji;for(i

pair来写容易很多

摘要:解题思路:pair第一个存学号第二个存成绩然后用bool来进行判断加上sort排序注意事项:参考代码:#include<iostream>#include<algorithm>using namesp……

2916: 谁考了第k名

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;long long xh[10001],temp1;int m[10001];float sc……