首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
阿灿
2025年3月24日 22:31
成绩排序 题解:stablesort
P1151
回复 0
|
赞 4
|
浏览 97
#include<bits/stdc++.h> using namespace std; struct stu{ string n; int num; stu(string a,int b){ n=a; num=b; } }; bool big(stu a,stu b){ return a.num>b.num; } bool small(stu a,stu b){ return a.num<b.num; } int main(){ int n; int order; while(cin>...
18963489880
2025年2月28日 15:48
成绩排序 题解:为什么只对百分之50啊
P1151
回复 2
|
赞 6
|
浏览 327
#include <bits/stdc++.h> using namespace std; typedef struct { string name; int sc; }stu; int main() { int n,order; while(cin>>n>>order){ stu st[n]; stu ...
16696033405
2025年3月23日 10:46
成绩排序 题解:详细注释
P1151
回复 0
|
赞 3
|
浏览 97
#include <stdio.h> // 引入标准输入输出库 #define MAX 1000 // 定义最大学生数量 // 定义学生结构体,包含姓名(最多 10 个字符)和成绩 typedef struct { char name[10]; int grade; } Stu; int main() { int n, flag; // 变量 n 存储学生人数,flag 决定排序方式 Stu...
cc12345
2025年3月17日 11:30
成绩排序 题解:暴力冒泡排序,但只有66%后超时
P1151
回复 1
|
赞 5
|
浏览 169
#include <bits/stdc++.h> using namespace std; // 定义学生结构体 struct Student { string name; // 学生姓名 int score; // 学生分数 }; int main() { int way, count; cin >> count; // 输入学生数量 cin >> way; // 输入排序方式(0: 降序, 1: 升序) Student stu[100]; // 假设最...
samxz
2025年3月10日 16:13
成绩排序 题解:
P1151
回复 0
|
赞 16
|
浏览 330
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct stu { char name[1001]; int sc; } stu; int main() { int n; while(scanf("%d",&n)!=EOF) { int func; scanf("%d",&func); stu slist[2001]; int times=0; for (int i = 0; i < n...
jaygee_
2025年3月10日 07:44
成绩排序 题解:
P1151
回复 0
|
赞 10
|
浏览 265
#include <bits/stdc++.h> using namespace std; struct node { string name; int score; }; bool cmp_desc(node a, node b) { return a.score > b.score; } bool cmp_asc(node a, node b) { return a.score < b.score; } int main() { int n, ch; while...
wuyo
2025年3月3日 21:34
成绩排序 题解:大佬帮忙看看为什么50%
P1151
回复 1
|
赞 14
|
浏览 365
#include <iostream> #include <algorithm> #include <vector> #include <string> // 定义学生结构体 struct student { std::string name; int score; }; // 降序比较函数,使用引用传递参数 bool cmp1(const student& a, const student& b) { retu...
chenxx
2025年2月28日 11:19
成绩排序 题解:
P1151
回复 0
|
赞 13
|
浏览 282
#include <bits/stdc++.h> using namespace std; struct stu{ string name; int num; }; bool cg(const stu& a,const stu& b){ r...
赖建霖
2025年2月6日 11:05
成绩排序 题解:
P1151
回复 0
|
赞 8
|
浏览 357
通过索引让同分的输出按先后顺序排列 #include <bits/stdc++.h> using namespace std; struct Student { string name; int score; int index; // 记录学生输入的顺序 }; // 降序 bool compareDe(const Student &a, const Student &b) { if (a.score == b.sco...
ccccccyes
2024年9月7日 20:43
成绩排序 题解:
P1151
回复 0
|
赞 19
|
浏览 1.1k
//07/09/24 19:36 //07/09/24 20:37 #include <iostream> #include <algorithm> using namespace std; struct student{ string na; int sc; } stu[1005]; //数组要开大一点,测试数据比较多 bool cmpDec(student a,student b){ return a.sc > b.sc; } bool cmpInc(student a,stude...
1
2
3
...
5
题目
成绩排序
题解数量
45
发布题解
在线答疑
热门题解
1
成绩排序 题解:
2
成绩排序 题解:
3
成绩排序 题解:大佬帮忙看看为什么50%
4
成绩排序 题解:
5
成绩排序 题解:
6
成绩排序 纯C题解:
7
成绩排序 题解:
8
成绩排序 纯C题解另一思路(坚持使用qsort):
9
成绩排序 题解:用外部order省了一个函数位置
10
1151 成绩排序 清华上机 AC