Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

input 2d vector c++

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();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #vector
ADD COMMENT
Topic
Name
6+9 =