一种根据环境决定是中文输出英文输出的方式

#include <map> 
#include <iostream>
#include <string.h>
#include <atomic>
#include <time.h>

using namespace std;

int main()
{
    std::multimap<int, string> chinese{pair<int, string>(1, "媒体服务")};
    chinese.insert(pair<int, string>(2, "信令服务2"));
    chinese.insert(pair<int, string>(3, "中文3"));
    chinese.insert(pair<int, string>(4, "中文4"));
    chinese.insert(pair<int, string>(5, "中文5"));

    multimap<int, string> english{pair<int, string>(1, "MS gid is:")};
    english.insert(pair<int, string>(2, "GC gbid is"));
    english.insert(pair<int, string>(3, "english3"));
    english.insert(pair<int, string>(4, "english4"));
    english.insert(pair<int, string>(5, "english5"));
    english.insert(pair<int, string>(6, "english6"));

    multimap<int, string> work;

    work = chinese;//使用中文
    // for (auto it = work.begin(); it != work.end(); it++)
    // {
    //     cout << "it->first = " << it->first << " ,it->second = " << it->second << endl;
    // }
    pair<int, string> ret;

    auto ret1 = work.find(1);
    auto ret2 = work.find(2);
    cout << ret1->second << "11111111111 , " << ret2->second << " 2222222222222" << endl;

    work = english;//使用英文
    auto ret3 = work.find(1);
    auto ret4 = work.find(2);
    cout << ret3->second << "11111111111 , " << ret4->second << " 2222222222222" << endl;
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值