标签:pre color iterator vector bsp push 嵌套 back style
int main() { int n,m,k; cin>>n>>m; vector< vector<int> > vc; rep(1,n) { vector<int>vec; for(int j=0;j<=m;j++) { cn(k); vec.push_back(k); } vc.push_back(vec); } rep(0,n-1) { for(int j=0;j<=m;j++) ct vc[i][j] <<" "; ct endl ; } vector< vector<int> >::iterator iter; vector<int>::iterator it; for(iter=vc.begin();iter!=vc.end();iter++) { for(it=(*iter).begin();it<(*iter).end();it++) ct *it <<" "; ct endl; } }
2 3 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
int main() { int n,m,k; cin>>n>>m; vector< vector<int> > vc; vector<int>vec; rep(1,n) { for(int j=0;j<=m;j++) { cn(k); vec.push_back(k); } vc.push_back(vec); } rep(0,n-1) { for(int j=0;j<=m;j++) ct vc[i][j] <<" "; ct endl ; } vector< vector<int> >::iterator iter; vector<int>::iterator it; for(iter=vc.begin();iter!=vc.end();iter++) { for(it=(*iter).begin();it<(*iter).end();it++) ct *it <<" "; ct endl; } }
2 3 1 2 3 4 5 6 7 8 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 5 6 7 8
标签:pre color iterator vector bsp push 嵌套 back style
原文地址:https://www.cnblogs.com/Shallow-dream/p/11421540.html