2916: 谁考了第k名 (结构体+sort函数) 摘要:解题思路: 1.定义结构体 2.循环输入数据 3.sort排序 4.输出第k名注意事项:参考代码:#include <bits/stdc++.h> using namespace std; …… 题解列表 2023年05月23日 0 点赞 0 评论 643 浏览 评分:0.0
谁考了第k名 C++ ```cpp#includeusingnamespacestd;//定义学生结构体structStudent{intid;//学号floatscore;//成绩};//自定义比较函数,根据score字段比较学生记录boolcompare(constStudent&a, 题解列表 2024年12月28日 0 点赞 0 评论 498 浏览 评分:0.0
谁考了第k名c++ 摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; struct Student{ int id; double …… 题解列表 2022年11月02日 0 点赞 0 评论 547 浏览 评分:9.9
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 题解列表 2022年11月30日 0 点赞 0 评论 518 浏览 评分:9.9
pair来写容易很多 摘要:解题思路:pair第一个存学号第二个存成绩然后用bool来进行判断加上sort排序注意事项:参考代码:#include<iostream>#include<algorithm>using namesp…… 题解列表 2023年04月25日 0 点赞 0 评论 562 浏览 评分:9.9
2916: 谁考了第k名 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;long long xh[10001],temp1;int m[10001];float sc…… 题解列表 2023年05月24日 0 点赞 0 评论 606 浏览 评分:9.9