Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int parzyste = 0, nieparzyste = 0, liczba;
- do
- {
- cin >> liczba;
- if(liczba %2 == 0)
- ++parzyste;
- else
- ++nieparzyste;
- } while(liczba != 0);
- cout << "Wczytano " << nieparzyste << " nieparzystych liczb i " << parzyste << " parzystych.\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment