Advertisement
MeehoweCK

Untitled

Jun 5th, 2023
1,058
0
Never
1
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 parzyste = -1, nieparzyste = 0, liczba;
  8.     cout << "Podaj liczby calkowite. Podanie 0 konczy wczytywanie: ";
  9.     do
  10.     {
  11.         cin >> liczba;
  12.         if (liczba % 2 == 0)
  13.             ++parzyste;
  14.         else
  15.             ++nieparzyste;
  16.     } while (liczba != 0);
  17.     cout << "Wpisales " << parzyste << " liczby parzyste i " << nieparzyste << " liczby nieparzyste.\n";
  18.     return 0;
  19. }
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement