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