1792: 【CSP数组】求和▅
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:6
Solved:6
Description
输入 n ( 1≤n≤5000 )个正整数,每个数都在 1 到 20000 之间;要求对这 n 个数中的奇数和偶数分别求和。
Input
第一行,一个正整数 n ( 1≤n≤5000 )。
第 2∼n+1 行,每行一个正整数,每个数都在 1到20000 之间。
Output
输出文件共有二行,每行包含一个整数,第一行为所有奇数之和,第二行为所有偶数之和。
Sample Input Copy
5
3
10
7
5
8
Sample Output Copy
15
18