Advertisement
MeehoweCK

Untitled

Nov 30th, 2020
885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, suma = 0;
  8.  
  9.     do
  10.     {
  11.         cout << "Wpisz liczbe (0 konczy wczytywanie): ";
  12.         cin >> liczba;
  13.         switch(liczba)
  14.         {
  15.         case 0:
  16.             break;
  17.         default:
  18.             suma += liczba;
  19.         }
  20.     } while(liczba != 0);
  21.  
  22.     cout << "Suma wczytanych liczb wynosi " << suma << endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement