2014 young artist contest AC and 2014 artist contest

Source: Internet
Author: User

2014 young artist contest AC and 2014 artist contest

Young Artist Grand Prix _ evaluation board score

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)

Total Submission (s): 56915 Accepted Submission (s): 28404

 

 

Problem Description

During the young singer Grand Prix, the jury scored 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.

 

 

Input

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 contestant is retained with two decimal places in the result, and each group of output occupies one row.

 

 

Sample Input

3 99 98 97

4 100 99 98 97

 

 

Sample Output

98.00

98.50

 

 

Author

Lcy

 

 

Source

C language programming exercises (III)

 

 

Recommend

Lcy

 

# Include <stdio. h>

# Include <stdlib. h>

Int main ()

{

Float aver, a [100], sum, max, min;

Int I, n;

While (scanf ("% d", & n )! = EOF)

{

Sum = 0; aver = 0;

For (I = 0; I <n; I ++)

Scanf ("% f", & a [I]);

Max = a [0];

Min = a [0];

For (I = 0; I <n; I ++)

{

If (a [I]> max)

Max = a [I];

If (a [I] <min)

Min = a [I];

Sum + = a [I];

}

Aver = (sum-max-min)/(n-2 );

Printf ("%. 2f \ n", aver );

}

}

 

Related Article

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.