Advertisement
Filip13

parno neparni

Oct 26th, 2022
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n;
  8. cin >> n;
  9. int broj;
  10. bool parnost = true;
  11. bool redom = true;
  12.  
  13. for (int i = 0; i <= n; i++) {
  14. cin >> broj;
  15. if (broj % 2 != 0) parnost = false;
  16. else if (broj % 2 == 0 && parnost == false) redom = false;
  17. }
  18. if (redom == true) cout << "da";
  19. if (redom == false) cout << "ne";
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement