Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int polje[8] = { 5, 3, 5, 4, 8, 8, 2, 1 };
- int trazimo = 8;
- int brojac = 0;
- for (int i = 0; i < 8; i++)
- {
- if (polje[i] == trazimo)
- {
- brojac++;
- }
- }
- if (brojac % 2 == 0)
- {
- cout << "Broj " << trazimo << " se pojavljuje paran broj puta." << endl;
- }
- else
- {
- cout << "Broj " << trazimo << " se pojavljuje neparan broj puta." << endl;
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment