Last active
May 20, 2016 05:54
-
-
Save tyricec/e331159dbf686640c9c29dd7c31942fc to your computer and use it in GitHub Desktop.
Hw8 example output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main() { | |
int i = 0; | |
int size = 0; | |
vector<int> v1(0); | |
vector<int> v2(0); | |
cout << "Enter size for vectors" << endl; | |
cin >> size; | |
v1.resize(size); | |
v2.resize(size); | |
for (i = 0; i < v1.size(); ++i) { | |
v1[i] = i * 1000; | |
v2[i] = i * 2000; | |
} | |
for (i = 0; i < v1.size(); ++i) { | |
if (i == v1.size() - 1) { | |
cout << v1[i]; | |
} else { | |
cout << v1[i] << ", "; | |
} | |
} | |
cout << endl; | |
for (i = 0; i < v2.size(); ++i) { | |
if (i == v1.size() - 1) { | |
cout << v2[i]; | |
} else { | |
cout << v2[i] << ", "; | |
} | |
} | |
cout << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment