Tradtional way to iterator is too complex,so I always try to find the easiest way to complete this function.And now I stumbled upon the answer
Newest Effective Way:
cout<<"auto"<<endl; for (auto i:try0) { for(auto j:i) cout <<j << " "; cout << endl; }
Traditonal Way:
for(vector<vector<string>>::iterator ite=try0.begin();ite!=try0.end();ite++) { temp=*ite; for(vector<string>::iterator it=temp.begin();it!=temp.end();it++) { cout<<*it<<endl; } } for (vector<vector<string>>::iterator it = try0.begin(); it != try0.end(); ++it){ for (int i = 0; i < (*it).size(); ++i) cout << (*it)[i] << " " ; } int i,j; cout<<endl; for (i = 0; i < try0.size(); i++) { for(j = 0; j < try0[0].size(); j++) cout << try0[i][j] << " "; cout << endl; }
愿为天下目,萃聚六路华
浙公网安备 33010602011771号