信息学奥赛一本通T1176-谁考了第k名-题解(C++代码) #自定义排序cmp即可```c#includeusingnamespacestd;intm,n;structT{inta;doubleb;}a[105];boolcmp(Ta,Tb){returna.b>b.b;}intmain(){intn, 题解列表 2020年07月21日 0 点赞 0 评论 2783 浏览 评分:5.5
2328: 信息学奥赛一本通T1176-谁考了第k名(C++代码)自定义sort规则排序 解题思路:用学生数组记录数据自定义比较函数,利用sort函数排序输出对应的下标[k-1]的成员学号与成绩即可注意事项:题目要求%g输出分数,用scanf函数输出比较方便但如果学号是string类型不能直接直接用scanf输出学号参考代码:#includeusingname 题解列表 2021年03月12日 3 点赞 0 评论 2217 浏览 评分:7.9
pair方法解决,方便易懂 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;typedef pair<int,double> bai…… 题解列表 2023年04月26日 0 点赞 0 评论 773 浏览 评分:9.9
冒泡排序c++ 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;struct student{ int name; double s…… 题解列表 2023年11月09日 0 点赞 0 评论 848 浏览 评分:0.0