Hamoudi30

Untitled

Mar 10th, 2022 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define SZ(v) ((int)(v.size()))
  5. #include <ext/pb_ds/assoc_container.hpp>
  6. #include <ext/pb_ds/tree_policy.hpp>
  7. using namespace __gnu_pbds;
  8. template<class T> using indexed_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
  9. constexpr int N = 52;
  10. constexpr int mod = 1e9+7;
  11. void run () {
  12.     string line;
  13.     int sum, value;
  14.     do
  15.     {
  16.         if (!getline(cin, line) || line.empty())
  17.             break;
  18.  
  19.         istringstream iss(line);
  20.         sum = 0;
  21.         while (iss >> value)
  22.             sum += value;
  23.  
  24.         cout << "sum : " << sum << endl;
  25.     }
  26.     while (true);
  27. }
  28. int main() {
  29.     ios_base::sync_with_stdio(false);
  30.     cin.tie(nullptr);
  31.     cout.tie(nullptr);
  32. //    freopen("/home/hamoudi/Coding/run.in", "r", stdin);
  33.     int tt = 1;
  34.     cin >> tt;
  35.     while (tt--)
  36.         run();
  37.     return 0;
  38. }
Add Comment
Please, Sign In to add comment