Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- cout <<" wpisz liczbe";
- cin >> a;
- int parzyste = -1;
- int nieparzyste = 0;
- if(a % 2 == 0)
- parzyste = parzyste + 1; // parzyste += 1; parzyste++; ++parzyste;
- else
- nieparzyste = nieparzyste + 1; // nieparzyste += 1; nieparzyste++; ++nieparzyste;
- while(a != 0)
- {
- cin >> a;
- if(a % 2 == 0)
- parzyste = parzyste + 1;
- else
- nieparzyste = nieparzyste + 1;
- }
- cout <<"Liczby parzyste "<< parzyste << endl;
- cout <<"Liczby nieparzyste "<< nieparzyste << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment