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

奇偶统计 - 题解

#include <bits/stdc++.h>
using namespace std;

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