MeehoweCK

Untitled

Jun 4th, 2024
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. int main() {
  2.     std::cout << "Podaj liczby calkowite. 0 konczy wczytywanie: ";
  3.     int liczba, parzyste{ -1 }, nieparzyste{};
  4.     do {
  5.         std::cin >> liczba;
  6.         liczba % 2 == 0 ? ++parzyste : ++nieparzyste;
  7.     } while (liczba != 0);
  8.     std::cout << "Parzyste: " << parzyste << std::endl;
  9.     std::cout << "Nieparzyste: " << nieparzyste << std::endl;
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment