1std::vector<vector<int>> d;
2//std::vector<int> d;
3cout<<"Enter the N number of ship and port:"<<endl;
4cin>>in;
5cout<<"\Enter preference etc..:\n";
6for(i=0; i<in; i++){
7cout<<"ship"<<i+1<<":"<<' ';
8 for(j=0; j<in; j++){
9 cin>>temp;
10 d[i].push_back(temp);
11 }
12}
1vector<vector<int> > d;
2int val;
3for(int i = 0; i < in; i++){
4 vector<int> temp;
5 for(int j = 0; j < in; j++){
6 cin >> val;
7 temp.push_back(val);
8 }
9 d.push_back(temp);
10 temp.clear();
11}
12From SpyrosD3v25
1vector<vector<int> > d;
2int val;
3for(int i = 0; i < in; i++){
4 vector<int> temp;
5 for(int j = 0; j < in; j++){
6 cin >> val;
7 temp.push_back(val);
8 }
9 d.push_back(temp);
10 temp.clear();
11}
12
1std::vector<vector<int>> d;
2//std::vector<int> d;
3cout<<"Enter the N number of ship and port:"<<endl;
4cin>>in;
5cout<<"\Enter preference etc..:\n";
6for(i=0; i<in; i++){
7cout<<"ship"<<i+1<<":"<<' ';
8 for(j=0; j<in; j++){
9 cin>>temp;
10 d.push_back(temp);// I don't know how to push_back here!!
11 }
12}