Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int length;
- cout <<"How many names/ids do you have? \n";
- cin >> length;
- string name_list[length];
- int id_list[length];
- for (int subscript = 0; subscript < length; subscript++)
- {
- cout << "Enter name " << subscript << endl;
- cin >> name_list[subscript];
- cout << "Enter " << name_list[subscript] << "'s ID\n";
- cin >> id_list[subscript];
- }
- cout << "Done gathering input. You entered: \n";
- for(int subscript = 0; subscript < length; subscript++)
- {
- cout << id_list[subscript] << " -> " << name_list[subscript] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement