Advertisement
Qpel

2uzd

Dec 21st, 2016
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.     int M, kaina = 0, kiekis = 0, v = 0;
  9.  
  10.  
  11.     for(int i = 0; i < 9999; i++){
  12.         cin >> M;
  13.         if(M == 00) break;
  14.         else{
  15.         kaina+=M/10;
  16.         kiekis+=M%10;
  17.         v++;
  18.         }
  19.     }
  20.  
  21.     cout << "Kaina = " << kaina << ", kiekis = " << kiekis << ", viso = " << v;
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement