题解 | #牛牛的书#

牛牛的书

https://www.nowcoder.com/practice/30bb969e117b4f6d934d4b60a2af7489

#include <cstdio>
#include <iostream>
#include <map>
#include <string>
using namespace std;

int main() {
    int n;
    cin >> n;
    map<int, string> m;
    string name;
    int price;
    while (cin >> name >> price) {
        m.insert(make_pair(price, name));
    }
    for (auto i : m) {
        cout << i.second << "\n";
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

达芬骐:一个月入门,一年熟悉,三年精通,五年掌握,十年会用
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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