主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
红毛舒肤佳
2024年3月10日 17:10
成绩排序 题解:数据率百分66时,检查while(cin>>n)
P1151
回复 0
|
赞 0
|
浏览 336
#include <bits/stdc++.h> using namespace std; struct student{ string name; int score; }; bool Cmpdesc(student a,student b){//降序排序 return a.score>b.score; } bool Cmpasc(student a,student b){//升序排序 return a.score<b.score; } int main(){ int n,m;//n代表输入数...
FIVEszc
2024年3月9日 22:23
成绩排序 题解:C++ 不使用stable_sort的一种思路
P1151
回复 0
|
赞 0
|
浏览 280
#include <bits/stdc++.h> using namespace std; struct student{ char name[20]; int grade; int seq; } ; bool comp1(student lhs,student rhs) { if(lhs.grade<rhs.grade) return true; else if(lhs.grade==rhs.grade&&lhs.seq<rhs.seq) ret...
Cookie‘s AE86
2024年3月8日 18:09
成绩排序 题解:用c++的stable_sort()写的,正确率只有6
P1151
回复 3
|
赞 0
|
浏览 323
#include<bits/stdc++.h> using namespace std; typedef struct node{ string name; int score; }cj; bool cmp_dec(cj a,cj b){ return a.score > b.score; } bool cmp_asc(cj a,cj b){ return a.score < b.score; } int main(){ int n, judge; cin >...
1556501014
2024年3月9日 22:13
成绩排序 题解:
P1151
回复 0
|
赞 1
|
浏览 187
#include<iostream> using namespace std; #include<string> #include<map> class Mycompare//降序排序 { public: bool operator()(int v1, int v2) { return v1 > v2; } }; ...
Gejiao
2024年3月8日 18:43
成绩排序 题解:
P1151
回复 2
|
赞 0
|
浏览 337
//通过率%83 求助 实在找不出问题了!!! #include<stdio.h> #include<malloc.h> typedef struct _student_info_ { char s_name[32]; //姓名 int s_score; //成绩 }student_info; int Sort(student_info *p,int n,int j) { student_info temp; ...
zx142407789
2024年3月8日 16:12
成绩排序 题解:求助通过率83%
P1151
回复 1
|
赞 0
|
浏览 325
#include<stdio.h> #include<stdlib.h> typedef struct { char name[50]; int score; }number; void BubbleSortDown(number* array, int length) { for (int i = length - 1; i > 0; i--) { for (int j = 0; j < i; j++) { if (array[i].score > array[j].score) { numbe...
A001
2024年3月7日 16:03
成绩排序 题解:请问为什么报“Compile Error"呢?我在vs
P1151
回复 4
|
赞 0
|
浏览 317
#include<stdio.h> #include<string.h> #include<stdlib.h> struct People{ char name[10]; int grade; }; int m,n; void exchange(People x[1000],int i,int j){ char t[10];int p; st...
williams
2024年3月6日 16:09
纯c 插排代替stable_sort
P1151
回复 2
|
赞 1
|
浏览 362
#include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> //0为降序 1为升序 struct messenge{ char name[10]; int grade; }student[1000],temp; int main(void) { int number,list,j; while(scanf("%d",&number)!=EOF){ scanf(...
小李122333
2024年1月14日 19:42
成绩排序 题解:c++ stable_sort函数解决
P1151
回复 2
|
赞 1
|
浏览 724
#include <bits/stdc++.h> using namespace std; struct node{ string name; int score; }; int cmp1(node n1,node n2){ return n1.score>n2.score; } int cmp2(node n1,node n2){ return n1.score<n2.score; } int main(){ int n,m; while(cin>>n&g...
orderrr
2024年2月25日 10:43
成绩排序 题解:
P1151
回复 0
|
赞 1
|
浏览 349
这个题 需要 使用结构体来存储 学生姓名以及分数,还要自己定义排序的规则,sort函数排序时不稳定的,所以可以利用stable_sort函数进行排序,这个函数与sort函数的用法是一样的。 #include <bits/stdc++.h> using namespace std; struct student { string name; int score; }; bool cmpStudent1(student p, student q) { return p.score > q.score; } bool cmpStud...
1
2
3
4
题目
成绩排序
题解数量
34
发布题解
热门题解
1
清华上机:成绩排序1151
2
1151 成绩排序 清华上机 AC
3
成绩排序 纯C题解另一思路(坚持使用qsort):
4
成绩排序 题解:
5
成绩排序 题解:
6
成绩排序 (结构体数组)题解:
7
成绩排序 纯C题解:
8
成绩排序 题解:
9
成绩排序 题解:
10
纯c 插排代替stable_sort