Advertisement
193030

Cin

Apr 1st, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int k = 0;
  7.     cin>>k;
  8.     cin.ignore();
  9.  
  10.     string input;
  11.     int sum = 0;
  12.         while(k--)
  13.         {
  14.            
  15.             while(cin>>input)
  16.             {
  17.          //   cin.ignore();
  18.             sum += stoi(input);
  19.             }
  20.             cout << "Printirame sumata" << sum << endl;
  21.             sum =0;
  22.         }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement