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

奇偶统计 - 题解

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

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