鱼C论坛

 找回密码
 立即注册
查看: 1272|回复: 1

[已解决]编程填空:按要求输出

[复制链接]
发表于 2018-11-10 23:59:58 | 显示全部楼层 |阅读模式
1鱼币
下列程序的输出为"10 13 18 15 17 12 16 19",  请补充代码

#include <iterator>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <stack>
#include <iostream>
#include <set>
using namespace std;
int  a[10] = {0, 6, 7, 3, 9, 5, 8, 6, 4, 9};
int  b[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
int main(int argc, char** argv) {
// 在此处补充你的代码
for(int i=0; i<10; i++)
                c[a[i]] = b[i];
        for(it=c.begin(); it!=c.end(); it++)
                cout<<it->second<<" ";
        return 0;
}
最佳答案
2018-11-10 23:59:59
map<int,int> c;
map<int,int>::iterator it;
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2018-11-10 23:59:59 | 显示全部楼层    本楼为最佳答案   
map<int,int> c;
map<int,int>::iterator it;
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-10-2 22:16

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表