Hangzhou (Hangzhou), 2014 19:09:13

Source: Internet
Author: User
Young Artist Grand Prix _ evaluation board score

Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 46823 accepted submission (s): 23468


In the Problem description young singer Grand Prix, the jury scored the contestants. The contestant scoring rule is to remove one highest score and one lowest score, and then calculate the average score. program the score of a contestant.

 

There are multiple groups of input data. Each group occupies one row. The first number of each row is N (2 <n <= 100), which indicates the number of judges and then scores of N judges.

 

Output: for each group of input data, the score of the output player is retained with two decimal places. Each group of output occupies one row.

 

Sample input3 99 98 974 100 99 98 97

 

Sample output98.0098.50
 1 #include<cstdio> 2 int main() 3 { 4     int n; 5     while(scanf("%d",&n)==1) 6     { 7         if(n<=2||n>100)return 0; 8         int maxs=0,mins=10000; 9         float sum=0;10         for(int i=0;i<n;i++)11         {12             int mm;13             scanf("%d",&mm);14             if(mins>mm)mins=mm;15             if(maxs<mm)maxs=mm;16             sum=sum+mm;17         }18         sum=(sum-maxs-mins)/(n-2);19         printf("%.2f\n",sum);20     }21     return 0;22 }

 

Hangzhou (Hangzhou), 2014 19:09:13

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.