vector 是个模板 在调用的时候,必须按照模板的格式写:
vector
vector
扩张时resize即可。
vector 是个模板,你掉用的时候,必须按照模板的格式写亚:
vector
vector
基础加强了。
初始化一个m x n的二维数组,初始值为0;
vector
初始化一个m x n的二维数组,初始值为1;
vector
/*
* File: main.cpp
* Author: chujiangke
*
* Created on 2013年4月10日, 下午5:44
*/
#include
#include
#include
#include
#include
#include
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
vector
cout <<"input vector A:"<< endl;
int m;
while(getchar()!='\n')
{
cin >> m;
a.push_back(m);
}
cout <<"input vector B:"<< endl;
int n;
while(getchar()!='\n')
{
cin >> n;
b.push_back(n);
}
vector
vvect.push_back(a);
vvect.push_back(b);
return 0;
}
首先呢,可以不用初始化
直接定义就可以
例如:vector
插入的值类型是vector