返回题解分享
讨论 / 题解分享/ 帖子详情

奇偶统计改 - 题解

//模板
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define INF 0x3f3f3f3f3f3f3f3f
#define int long long

signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int n , cnt = 0 , ans = 0;
	
	while(cin >> n)
	{
		if(n % 2 == 0)
		{
			cnt++;
		}
		else{
			ans += n;
		}
	}
	
	cout << cnt << endl	<< ans ;
	
	return 0;
}
0 回复 0 转发 0 喜欢 6 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!