All pastes #923968 Raw Edit

Untitled

public text v1 · immutable
#923968 ·published 2008-02-29 23:52 UTC
rendered paste body
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;

int main() {
	
	const int V_SIZE = 10;	// define the vector size here
	
	// Create three vectors and allocate their size
	vector<int> u(V_SIZE);
	vector<int> v(V_SIZE);
	vector<int> w(V_SIZE);
	
	// Populate vectors u & v with integers
	for(int i = 0; i < V_SIZE; i++) {
    	u[i] = i;
		v[i] = i;
		w[i] = u[i] + v[i];
	}

	// Print the contents of the vector
	for(int i = 0; i < V_SIZE; i++) {
	    cout << "V1: " << u[i] << ", V2: " << v[i] << ", V3: " << w[i] << endl;
	}
	cout << endl;

	return 0;
}