Advertisement
Seal_of_approval

PrVecList1B

Jul 3rd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main (void)
  8. {
  9.     ifstream in ("input.txt");
  10.  
  11.     int a;
  12.     vector <int> vec;
  13.  
  14.     while (in >> a)
  15.         vec.push_back(a);
  16.    
  17.     int i;
  18.     i = vec.size()/2;
  19.     vec[i] = vec[i] % 3;
  20.  
  21.     for (int i = 0; i < vec.size(); i++)
  22.         cout << vec[i] << " ";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement