Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int parzyste = -1, nieparzyste = 0, liczba;
- cout << "Podaj liczby calkowite. Podanie 0 konczy wczytywanie: ";
- do
- {
- cin >> liczba;
- if (liczba % 2 == 0)
- ++parzyste;
- else
- ++nieparzyste;
- } while (liczba != 0);
- cout << "Wpisales " << parzyste << " liczby parzyste i " << nieparzyste << " liczby nieparzyste.\n";
- return 0;
- }
Advertisement
Advertisement