MeehoweCK

Untitled

Aug 24th, 2019
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba = 1, parzyste = -1, nieparzyste = 0;
  8.  
  9.     while(liczba != 0)
  10.     {
  11.         cin >> liczba;
  12.         if(liczba % 2 == 0)
  13.             ++parzyste;
  14.         else
  15.             ++nieparzyste;
  16.     }
  17.  
  18.     cout << "parzyste: " << parzyste << endl;
  19.     cout << "nieparzyste: " << nieparzyste << endl;
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment