總時間限制:
1000ms
內存限制:
65536kB
// 在此處補充你的代碼
描述
下列程序的輸出爲"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; }
輸入
無
輸出
10 13 18 15 17 12 16 19
樣例輸入
None
樣例輸出
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) {
map<int,int>c;
map<int,int>::iterator it;
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;
}