[정올] Language Coder_배열1_형성평가3_code152 (C)
두비니
·2020. 4. 15. 13:44
#include <stdio.h>
int main() {
int n, arr[10], sum = 0, sum2 = 0;
for (int i = 0; i < 10; i++) {
scanf("%d", &arr[i]);
if (i % 2 == 0)
sum += arr[i];
else
sum2 += arr[i];
}
printf("odd : %d\n", sum);
printf("even : %d", sum2);
return 0;
}
'Coding_Algorithm > 정올 문제풀이' 카테고리의 다른 글
[정올] Language Coder_배열1_형성평가5_code152 (C) (0) | 2020.11.28 |
---|---|
[정올] Language Coder_배열1_형성평가4_code153 (C) (0) | 2020.11.27 |
[정올] Language Coder_배열1_형성평가2_code151 (C) (0) | 2020.04.14 |
[정올] Language Coder_배열1_형성평가1_code150 (C) (0) | 2020.04.13 |
[정올] Language Coder_배열1_자가진단8_code562 (C) (0) | 2020.04.12 |