Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int niza[n];
- for(int i = 0; i < n; i++) {
- cin >> niza[i];
- }
- int paren_zbir = 0;
- int neparen_zbir = 0;
- for(int i = 0; i < n; i++) {
- if(niza[i] % 2 == 0) {
- paren_zbir += niza[i];
- }
- else {
- neparen_zbir += niza[i];
- }
- }
- if(paren_zbir > neparen_zbir) {
- cout << "Pogolem e parniot zbir: " << paren_zbir << endl;
- }
- else {
- cout << "Pogolem e neparniot zbir: " << neparen_zbir << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement