解题思路:
注意事项:
参考代码:
#include<iostream>
#include<set>
using namespace std;
int main(void)
{
int i,temp;
int n;
int ans,len;
multiset<int>::iterator j;
while(cin>>n&&n)
{
multiset<int>st;
ans=0;
len=n;
while(n--)
{
cin>>temp;
st.insert(temp);
}
for(j=st.begin(),i=0;i<len/2+1;j++,i++)
{
ans+=(*j/2+1);
}
cout<<ans<<endl;
}
return 0;
}
0.0分
0 人评分
奖学金 (C++代码)浏览:2000 |
A+B for Input-Output Practice (V) (C++代码)浏览:450 |
A+B for Input-Output Practice (IV) (C++代码)浏览:676 |
简单的a+b (C语言代码)浏览:573 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:504 |
WU-C语言程序设计教程(第三版)课后习题12.1 (C++代码)浏览:918 |
愚蠢的摄影师 (C++代码)浏览:925 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:551 |
简单的a+b (C语言代码)浏览:478 |
数组与指针的问题浏览:715 |