jasonpogi1669

Vector-Tuple Container using C++

Aug 11th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     vector<tuple<int, int, int>> v(n);
  9.     for (int i = 0; i < n; i++) {
  10.         int a, b, c;
  11.         cin >> a >> b >> c;
  12.         v[i] = make_tuple(a, b, c);
  13.     }
  14.     for (auto it = v.begin(); it != v.end(); it++) {
  15.         cout << get<0>(*it) << " " << get<1>(*it) << " " << get<2>(*it) << '\n';
  16.     }
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment