84分救
  • 板块P1104 生日
  • 楼主hexuchen
  • 当前回复7
  • 已保存回复7
  • 发布时间2023/7/10 10:26
  • 上次更新2023/11/3 10:49:05
查看原帖
84分救
945742
hexuchen楼主2023/7/10 10:26
#include <bits/stdc++.h>
using namespace std;
struct student{
	string name;
	int year,month,day;
};
bool cmp(student a,student b){
	if(a.year!=b.year)
		return a.year<b.year;
	if(a.month!=b.month)
		return a.month<b.month;
	if(a.day!=b.day)
		return a.day<b.day;
	return false;
}
int main(){
	int n;
	student s[101];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s[i].name>>s[i].year>>s[i].month>>s[i].day;
	}
	sort(s,s+n,cmp);
	for(int i=0;i<n;i++){
		cout<<s[i].name<<endl;
	}
	return 0;
}

m的最后一个点错了,但最后一个点90多个人...... 根本检查不了啊QAQ

2023/7/10 10:26
加载中...