#include <iostream> (30316)#include <iomanip> using namespace std; int main() { int n; cin >> n; int scores[100]; int count = 0; double sum = 0; for (int i = 0; i < n; ++i) { cin >> scores[i]; if (scores[i] % 2 == 0) { sum += scores[i]; count++; } } if (n == 0 || count == 0) { cout << "No result!" << endl; } else { for (int i = 0; i < n; ++i) { if (scores[i] % 2 == 0) { cout << scores[i] << " "; } } cout << endl; cout << fixed << setprecision(2) << sum / count << endl; } return 0; }
点赞 3

相关推荐

LZStarV:冲就好了,就算真的是字节也冲,面评脏了大不了等三四个月就淡了,而且等到那个时候实力进步了选择还多,何必拘泥于字节
点赞 评论 收藏
分享
用微笑面对困难:你出于礼貌叫了人一声大姐,大姐很欣慰,她真把你当老弟
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务