MeehoweCK

Untitled

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