fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. struct info {
  6. int st, en, val;
  7. };
  8.  
  9. int main() {
  10. int n, x, y;
  11. cin >> n;
  12. vector<info> arr(n);
  13. for (int i = 0; i < n; ++i) {
  14. cin >> x >> y;
  15. arr.push_back({x, y, y - x});
  16. }
  17. for (int i = 0; i < n; ++i) cout << arr[i].st << " " << arr[i].en << " " << arr[i].val << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 15240KB
stdin
12
1 2
3 5
0 4
6 8
7 13
4 6
9 10
9 12
11 14
15 19
14 16
18 20
stdout
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0