主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
huangdashuaige
2023年2月17日 15:13
P1159 成绩排序2.0
P1159
回复 0
|
赞 1
|
浏览 2.4k
#include <iostream> #include <algorithm> using namespace std; typedef struct st_nc{ //声明结构体 int num;//学号 float sco;//成绩 }ST; bool cmp(ST x,ST y){ //sort排序的规则 if(x.sco==y.sco) &nbs...
My_opt
2022年4月26日 16:48
c++(短代码)
P1159
回复 0
|
赞 1
|
浏览 4.6k
#include <iostream> #include <algorithm> using namespace std; int n, a; vector<pair<int, int>> s; int main() { cin >> n; while (cin >> n >> a) s.push_back({a, n}); stable_sort(s.begin(), s.end()); for (auto x : s) cout << x.sec...
fighting789456
2022年3月6日 17:21
无题
P1159
回复 0
|
赞 0
|
浏览 4.8k
``` #include<bits/stdc++.h> using namespace std; const int N=110; struct P{ int a,b; }p[N]; bool cmp(P a,P b){ if(a.b!=b.b) return a.b<b.b; return a.a<b.a; } int main(){ int...
杨德胜
2021年3月7日 20:11
P1159 解题思路分享
P1159
回复 0
|
赞 0
|
浏览 6.1k
#include <bits/stdc++.h> using namespace std; struct Student{ int id,grade; }; bool cmp(Student a, Student b){ if(a.grade==b.grade) return a.id<b.id; else return a.grade<b.grade; } int main() { int n; cin >>n; struct Student stu[n]; for(int i=0;i<...
老猫
2021年1月12日 20:36
sort
P1159
回复 0
|
赞 0
|
浏览 8.3k
#include <iostream> #include <string> #include <string.h> #include<algorithm> using namespace std; struct student { int id; int gore; }stu[200]; bool compare(student a,student b) { if(a.gore ==b.gore ) return a.id <b.id ; else return a.gore ...
FinalTaco
2020年3月26日 22:17
比较容易理解的作法
P1159
回复 0
|
赞 1
|
浏览 10.7k
#include using namespace std; struct student { int p; int q; }; bool compare (student x, student y){ if (x.q == y.q) &n...
风儿浪浪浪
2020年3月13日 13:47
C++
P1159
回复 0
|
赞 0
|
浏览 8.7k
#include <iostream> #include <algorithm> #include <utility> #include <cstring> using namespace std; bool cmp(pair<int, int> a, pair<int, int> b){ if(a.second < b.second) return 1;//比较函数,分数从低到高 if(a.second == b.second){//分数同学号从低到高 if(a.first...
1
2
3
题目
成绩排序2.0
题解数量
27
发布题解
热门题解
1
P1159 成绩排序2.0
2
成绩排序2.0 (C++)题解:
3
成绩排序2.0 题解:sort函数实现
4
c 简单数组冒泡
5
比较容易理解的作法
6
小坑的地方在于,必须要初始化一个student,然后push_back.
7
成绩排序2.0 题解:c++ sort函数+结构体
8
c++(短代码)
9
成绩排序2.0 题解:
10
成绩排序2.0 题解: