主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
我与代码的故事
2024年4月28日 23:29
成绩排序2.0 (C++)题解:
P1159
回复 0
|
赞 1
|
浏览 108
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> PII; const int N = 110; PII s[N]; int n; bool cmp(PII a, PII b) { if(a.second == b.second) return a.first < b.first; else return a.second < b.second; } int main() { cin >> ...
zsan
2024年3月23日 19:24
成绩排序2.0 题解:改了好多次了,一直都通过不了
P1159
回复 1
|
赞 0
|
浏览 219
#include<bits/stdc++.h> using namespace std; struct grade{ int num; int score; }g[105]; bool comp(grade l,grade r){ return l.score<r.score; } bool comp1(grade l,grade r){ return l.num<r.num; } int main() { &nb...
honevid
2024年3月18日 00:24
成绩排序2.0 题解:
P1159
回复 0
|
赞 0
|
浏览 222
#include <cstdio> #include <map> #include <string> #include <string.h> #include <cmath> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <set> #include <limits.h> using namespace std; ...
小酒
2024年3月17日 20:41
成绩排序2.0 题解:
P1159
回复 0
|
赞 0
|
浏览 180
1159解题思路:使用stable_sort()和结构体实现排序;先对学号排序,后对成绩排序; #include <bits/stdc++.h> using namespace std; struct Student{ int num; double pride; }stu[105]; bool array_DSC(Student a,Student b) { return a.pride<b.pride; } bool a_ASC(Student a,Student b) { return a...
lingdongyang
2024年3月16日 11:03
成绩排序2.0 题解:
P1159
回复 0
|
赞 0
|
浏览 222
#include<stdio.h> #include<stdlib.h> #include<string.h> struct Node { int id;//学号 int score;//成绩 }; int main() { int n; scanf("%d", &n); struct Node p[105];//初始化数组 for (int i = 0; i < n; i++) { scanf("%d %d", &p[i].id, &p[i].score); } /...
easymoney
2024年3月14日 14:08
成绩排序2.0 题解:
P1159
回复 0
|
赞 0
|
浏览 175
#include <stdio.h> #include <algorithm> #include <iostream> using namespace std; struct student { int num; int grade; }stu [1000]; bool asc(student a,student b){ if (a.grade == b.grade) &...
我爱陈少熙
2024年3月12日 17:21
成绩排序2.0 题解:c语言的qsort实现
P1159
回复 0
|
赞 0
|
浏览 175
#include<stdio.h> #include<stdlib.h> #include<string.h> struct stu { int num; int score; }s[]; int cmp(const void*a,const void*b) { struct stu *c=(struct stu*)a; struct stu *d=(struct stu*)b; if(c-...
FIVEszc
2024年3月10日 10:50
成绩排序2.0 题解:C++
P1159
回复 0
|
赞 0
|
浏览 221
#include <bits/stdc++.h> using namespace std; typedef struct student { int num; int grade; }; bool comp (student lhs,student rhs) { if(lhs.grade<rhs.grade) return true; else if(lhs.grade==rhs.grade && lhs.num<rhs.num) return true; ...
starry sky
2024年3月9日 21:38
成绩排序2.0 题解:
P1159
回复 0
|
赞 0
|
浏览 223
#include<iostream> #include<set> using namespace std; struct compare { bool operator()(const pair<int, int>& a, const pair<int, int>& b)const { if (a.second == b.second) &n...
A001
2024年3月8日 15:37
成绩排序2.0 题解:为什么通过数据只有75%啊 球球了 帮我找出错误
P1159
回复 2
|
赞 0
|
浏览 300
#include<stdio.h> #include<string.h> #include<stdlib.h> int m,n; int main(){ int x; scanf("%d",&x); int a[110];int b[110]; for(int i=0;i<x;i++) scanf("%d %d",&a[i],&b[i]); for(...
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 题解: