题解 | #小白鼠排队#

小白鼠排队

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

#include<bits/stdc++.h>
using namespace std;


int main(){
    int n;
    while(cin>>n){
        map<int,string> m;
        int i,weigh;
        string color;
        for(i=0;i<n;i++){
            cin>>weigh>>color;
            m[weigh]=color;
        }
        for(auto it=m.rbegin();it!=m.rend();it++)
            cout<<it->second<<endl;
    }
    return 0;
}

全部评论

相关推荐

用微笑面对困难:你出于礼貌叫了人一声大姐,大姐很欣慰,她真把你当老弟
点赞 评论 收藏
分享
10-22 19:44
门头沟学院 Java
面了100年面试不知...:那我得去剪个头
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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