Advertisement
smatskevich

Lesson9

Jan 14th, 2023
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.   ifstream fin("input.txt");
  9.   int x = 0;
  10.   vector<int> v;
  11.   while (fin >> x && x != 0) {
  12.     v.push_back(x);
  13.   }
  14.   cout << v.size() << std::endl;
  15.   cout << v.capacity() << std::endl;
  16.   return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement