#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
	int a[10];
    int odd = 0;
    int even = 0;

    for (int i = 0; i < 10; i++) {
        scanf("%d ", &a[i]);
    }
    
    for (int i = 0; i < 10; i++) {
        if (i % 2 == 0) {
            odd += a[i];
        }
        
        else {
            even += a[i];
        }
    }
    
    printf("odd : %d \n", odd);
    printf("even : %d \n", even);
	
	return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: