Advertisement
MeehoweCK

Untitled

Jul 8th, 2021
1,078
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.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba, licznikp = 0, licznikn = 0;
  8.     cin >> liczba;
  9.     while(liczba != 0)
  10.     {
  11.         if(liczba % 2 == 0)
  12.             ++licznikp;
  13.         else
  14.             ++licznikn;
  15.         cin >> liczba;
  16.     }
  17.     cout << "Liczby parzyste: " << licznikp << endl;
  18.     cout << "liczby nieparzyste: " << licznikn << endl;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement