Advertisement
MeehoweCK

Untitled

Dec 17th, 2020
1,108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba;
  8.     int parzyste=0;
  9.     int nieparzyste=0;
  10.     do
  11.     {
  12.         cin >> liczba;
  13.         if (liczba % 2 == 0)
  14.         {
  15.             parzyste += 1;
  16.         }
  17.         else
  18.         {
  19.             nieparzyste += 1;
  20.         }
  21.     }
  22.     while (liczba != 0);
  23.     cout << "ilosc parzystych=" << parzyste << '\n' << "ilosc nieparzystych=" << nieparzyste;
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement