MasterGun

Vector

Mar 28th, 2021 (edited)
443
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main() {
  2.     setlocale(LC_ALL, "rus");
  3.     vector<int> test;
  4.     int val = 0;
  5.     int size = 0;
  6.     cout << "Enter size" << endl;
  7.     cin >> size;
  8.     cout << "Input elements" << endl;
  9.     for (int i = 0; i < size; i++) {
  10.         cin >> val;
  11.         test.push_back(val);
  12.     }
  13.     for (int i = 0; i < test.size(); i++) {
  14.         cout << " " << endl;
  15.         cout << test[i] << endl;
  16.     }
  17.     return 0;
  18. }
RAW Paste Data