题解 | #小白鼠排队#

小白鼠排队

https://www.nowcoder.com/practice/27fbaa6c7b2e419bbf4de8ba60cf372b

#include <iostream>
#include <algorithm>
using namespace std;

const int N=110;
struct mouse{
    int w;
    string color;
    bool operator< (const mouse &t) const{
        return w>t.w;
    }
}a[N];
int main() {
    int n;
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i].w>>a[i].color;
    sort(a,a+n);
    for(int i=0;i<n;i++) cout<<a[i].color<<endl;
    return 0;
}

// 64 位输出请用 printf("%lld")

全部评论

相关推荐

脾气小祖宗:这简历摸到都得狠狠地消毒液洗手😂
点赞 评论 收藏
分享
10-13 16:58
门头沟学院 Java
面了100年面试不知...:一周七天,一天去一家上班😍😍😍
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务