#include #include #include #include using namespace std; int main() { vector scores; //born empty but can hold ints for (;;) { cout << "Please input a test score (or control-d when done): "; int s {0}; cin >> s; if (!cin) { //user types ctrl-d and it exits loop break; } scores.push_back(s); //adds user input to vector } cout << "\n\n"; cout << "Here are the " << scores.size() << " test scores you entered:\n"; for (size_t i {0}; i < scores.size(); ++i) { cout << setw(2) << i << " " << setw(4) << scores[i] << "\n"; } return EXIT_SUCCESS; }