天苜仙影


私信TA

用户名:2714425647

访问量:1753

签 名:

QID:TG92ZTA2

等  级
排  名 238
经  验 5904
参赛次数 9
文章发表 31
年  龄 18
在职情况 学生
学  校 中国地质大学(武汉)
专  业

  自我简介:

学过C语言,欢迎大家加我QQ交流

解题思路:

注意事项:

参考代码:

#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 人评分

  评论区