wei345 @ 2024-02-18 19:32:02
4,5过不了```cpp
using namespace std;
struct St{
string s;
int y,m,d,id,k;
}a[110];
int cmp(St a,St b){
if(a.k<b.k) return 1;
else if(a.k==b.k) return a.id<b.id;
return 0;
}
int n;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].s>>a[i].y>>a[i].m>>a[i].d;
a[i].id=i;
a[i].k=a[i].d+a[i].m100+a[i].y10000;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++){
cout<<a[i].s<<endl;
}
return 0;
}
by danlao @ 2024-02-18 20:23:39
Yes,你会摩斯密码啊!
by liuzilin114514 @ 2024-02-18 20:25:19
@yaodiguoan 其实不是
by danlao @ 2024-02-18 20:25:47
@liuzilin114514 ???
by liuzilin114514 @ 2024-02-18 20:26:20
@yaodiguoan 我光看见--
by danlao @ 2024-02-18 20:26:56
@liuzilin114514 ???
by liuzilin114514 @ 2024-02-18 20:27:53
@yaodiguoan 两个减号像一
by danlao @ 2024-02-18 20:29:05
@liuzilin114514 6
by wei345 @ 2024-02-18 20:30:14
@liuzilin114514 谢谢
by liuzilin114514 @ 2024-02-18 20:30:53
@wei345 不客气
by wei345 @ 2024-02-18 20:31:13
@yaodiguoan 冒泡会超时吧?