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

奇偶统计 - 题解

#include <stdio.h>
using namespace std;
int main(){

int count=0;
int sum=0;
int x;
while(cin>>x){
if(x==0)break;
if(x%2==0){count++;
}else{sum+=x;
}

}
cout<<count<<endl<<sum;
}


`
0 回复 0 转发 0 喜欢 4 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!