竞赛
考级
༺ཌༀ元气满满ༀད༻
结构体排序,自定义个函数,sort一下就行了
SJZ
别人还在用SORT的时候,我已经用上冒泡了,牛不牛X 咳咳,不是我不会,只是看天天用sort不好,就用冒泡来写,反正数据不大 对了,别人还在用结构体的时候,我用上了三维char数组..... 哎,我的思路不好讲,就伴随着代码讲吧 这个冒泡的效率由于数据小,出奇的高,用1ms和sort的应该也差不多了 谢谢观看,马上走开,不要回来!
葬仪_亡蝶舞
#include<bits/stdc++.h> using namespace std; struct student{ string c,n; long long chengji; }a[1000100]; bool cmp(student a,student b){ return a.c<b.c; } int main(){ int ac; cin>>ac; for(int i=0;i<ac;++i)cin>>a[i].c>>a[i].n>>a[i].chengji; sort(a,a+ac,cmp); for(int i=0;i<ac;++i)cout<<a[i].chengji<<"\n"; return 0; }
AC神
法兰西玫瑰
#include<bits/stdc++.h> using namespace std; struct name{ }a[100001]; void qsort(int left,int right){ } int main(){ }
大山天神贝利亚
MuktorFM
严格遵守知识点标签(快排)
zhouty
回来看看
acgoacgo
Phoebe
#include<bits/stdc++.h> using namespace std; struct student{ int id; string name; int score; }s[10005]; int cmp(student x , student y){ return x.id < y.id; } int main(){ int n; cin >> n; for(int i = 1;i <= n;i++) cin >> s[i].id >> s[i].name >> s[i].score; sort(s****+n+1,cmp); for(int i = 1;i <= n;i++) cout << s[i].score << '\n'; return 0; }
DARK SPECTRE
准