C_VectorMatrix - RとLinuxと...

RとLinuxと...


C_VectorMatrix

Programming

/Program/cpp/matrix_vector.cpp 他に/statistics/myR/RMatrix.cppを参照

#include<vector>
#include<iostream>

using namespace std;

int main()
{
 vector<int> vec[2];

 for(int z = 0;  z < 2; z++){
	for(int i = 1; i < 10; i++){
	  vec[z].push_back(i);
	}
	//	cout << z << endl;
 }

 for(int z = 0;  z < 2; z++){
	vector<int>::iterator pv = vec[z].begin();
	
	while(pv != vec[z].end()){
	  cout << *pv++ << ' ';
	}
	cout << endl;	
 }
 //  cout << endl;
 return 0;
}
 
Link: Programming(3061d)
Last-modified: 2008-06-17 (火) 18:09:02 (3867d)