北京大学机试-小白鼠排队
北京大学机试-小白鼠排队

#include<bits/stdc++.h>
using namespace std;
const int maxn = 105;
struct Mouse{
	int w;//重量
	char color[15];//颜色 
};
Mouse M[maxn];
bool cmp(Mouse x,Mouse y){
	return x.w>y.w;
}
int main(){
	int N;
	while(scanf("%d",&N)!=EOF){
		for(int i=0;i<N;i++){
			scanf("%d %s",&M[i].w,M[i].color);
		}
		sort(M,M+N,cmp);
		for(int i=0;i<N;i++){
			puts(M[i].color);
		}
	} 
	return 0;
} 

相关文章:

  • 2022-12-23
  • 2021-07-30
  • 2021-04-26
  • 2021-11-26
  • 2021-09-09
  • 2021-08-28
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2021-03-31
  • 2021-10-01
  • 2021-09-06
  • 2022-02-07
  • 2021-04-30
  • 2022-02-19
  • 2022-12-23
相关资源
相似解决方案