首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
GENARDING
2025年3月16日 14:08
vector,能快就快,把时间留给难题
P1404
回复 0
|
赞 3
|
浏览 422
#include<bits/stdc++.h> using namespace std; typedef struct student{ string name; int age; int score; }student; bool cmp(student a,student b){ if(a.score!=b.score){ return a.score<b.score; }else if(a.name!=b.name){ return a.name<b.name; }else{ return a.age&...
zxjrheaven
2025年3月15日 12:14
成绩排序 - 华科 题解:暴力
P1404
回复 0
|
赞 2
|
浏览 459
#include <bits/stdc++.h> using namespace std; struct student { string str; int score; int age; }stu[1005]; bool cmp(student a,student b) { if(a.score!=b.score)return a.score<b.score; &...
shiv15832
2025年3月10日 23:05
成绩排序 - 华科 题解:
P1404
回复 0
|
赞 1
|
浏览 431
知识点:在 C++ 中,string 类型重载了比较运算符(如 <, >, == 等),使得我们可以直接使用这些运算符来比较两个字符串的字典序。说人话就是字符串string的比较本身就是基于字典序,那问题就很简单了,只需要写一个cmp函数放进sort里就可以了。 代码:#include<bits/stdc++.h> using namespace std; typedef struct{ string name; int sc...
ASDF807
2025年3月8日 16:38
成绩排序 - 华科 题解:C语言:结构体
P1404
回复 0
|
赞 1
|
浏览 400
#include<stdio.h> #include<string.h> struct student{ char name[100]; int age; int grade; }; int main() { int n; while(scanf("%d",&n)!=EOF) ...
RingoCrystal
2025年1月31日 10:18
成绩排序 - 华科 题解:自定义排序函数
P1404
回复 0
|
赞 10
|
浏览 623
#include <bits/stdc++.h> using namespace std; struct SC{ string name; int age; int score; SC():name(""),age(0),score(0){} SC(string name,int age,int score):name(name),age(age),score(score){} void print(){ cout<<name<<" "<<age<...
Candour
2025年1月18日 15:40
成绩排序(函数sort) - 华科 题解:
P1404
回复 0
|
赞 5
|
浏览 525
#include<bits/stdc++.h> using namespace std; const int N = 1010; int n; struct student{ string name; int age; int score; }s[N]; bool cmp(student a, student b) { if(a.score == b.score) { if(a.name == b.name) return a.age < b.age; else return a.name < b.n...
carrot_huan
2024年3月22日 17:34
成绩排序 - 华科 题解:
P1404
回复 0
|
赞 1
|
浏览 955
#include<bits/stdc++.h> using namespace std; typedef struct Grade { string name; int year, grade; }; bool cmp(Grade* a, Grade* b) { if (a->grade != b->grade) { ...
小酒
2024年3月19日 11:04
成绩排序 - 华科 题解:
P1404
回复 0
|
赞 1
|
浏览 704
1404解题思路:重点在于是先排成绩,再排名字,最后排年龄,还是先排年龄,再排名字,最后排成绩。 #include <bits/stdc++.h> using namespace std; struct Student{ string name; int age; int grade; }stu[1000]; bool grade_ASC(Student a,Student b) { return a.grade<b.grade; } bool name_ASC(Student a,Student b) { return a...
张会老儿
2024年3月18日 20:37
成绩排序 - 华科 题解:请问大佬,我输入这样写的时候为什么会time
P1404
回复 1
|
赞 0
|
浏览 786
#include<stdio.h> #include<stdlib.h> #include<string.h> #include <stdbool.h> #include<algorithm> #include<string> #include <iostream> using namespace std; struct Student{ string name; int age; int grade...
huanghu
2024年3月18日 01:23
成绩排序 - 华科 题解:c++利用sort函数实现
P1404
回复 0
|
赞 4
|
浏览 1.2k
#include<stdio.h> #include<string.h> #include<string> #include<algorithm> #include<iostream> using namespace std; struct student{ string name; int age; float score; }; bool cmp(student a, student b){ if(a.score != b.score){ return a.score <...
1
2
题目
成绩排序 - 华科
题解数量
16
发布题解
在线答疑
热门题解
1
成绩排序 - 华科 题解:自定义排序函数
2
成绩排序(函数sort) - 华科 题解:
3
成绩排序 - 华科 题解:c++利用sort函数实现
4
vector,能快就快,把时间留给难题
5
成绩排序 - 华科 题解:C
6
成绩排序 - 华科 题解:暴力
7
成绩排序 - 华科 题解:
8
成绩排序 - 华科 题解:
9
成绩排序 - 华科 题解:
10
成绩排序 - 华科 题解:C语言:结构体