标签:cpp target content clu 输出 names ble print 投票
http://acm.ocrosoft.com/problem.php?cid=1316&pid=12
3
5 7 5
0
6
代码:
#include <bits/stdc++.h> using namespace std; int N; int num[110]; int ave[110]; int main() { int sum; while(~scanf("%d", &N)) { if(!N) break; sum = 0; for(int i = 1; i <= N; i ++) { scanf("%d", &num[i]); ave[i] = num[i] / 2; ave[i] ++; } sort(ave + 1, ave + 1 + N); for(int i = 1; i <= N / 2 + 1; i ++) sum += ave[i]; printf("%d\n", sum); } return 0; }
ocrosoft Contest1316 - 信奥编程之路~~~~~第三关 问题 M: 当总统
标签:cpp target content clu 输出 names ble print 投票
原文地址:https://www.cnblogs.com/zlrrrr/p/9726318.html