1149:0 starting point algorithm 56--young singer Grand Prix _ jury rating

Source: Internet
Author: User

1149:0 starting point algorithm 56--young singer Grand Prix _ Jury rating time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:1116 accepted:755
[Submit] [Status] [Web Board] Description

In the young Singers ' Grand Prix, the jury graded the contestants. The player scoring rule is to remove a maximum score and a minimum score, and then calculate the average score, please program to output a player's score.

Input

In the young Singers ' Grand Prix, the jury graded the contestants. The player scoring rule is to remove a maximum score and a minimum score, and then calculate the average score, please program to output a player's score.

Output

For each set of input data, the output contestant's score, the result retains 2 decimal places, each set of output occupies one row.

Sample Input
3 99 98 974 100 99 98 97

Sample Output
98.0098.50

Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     intn,a[ -],b[ -];4      while(SCANF ("%d", &n)! =EOF) {5          for(intI=0; i<n;i++){6scanf"%d",&a[i]);7         }8         9         intmax=a[0],min=a[0];Ten          for(intI=0; i<n;i++){ One             if(a[i]>max) Amax=A[i]; -             if(a[i]<min) -min=A[i]; the         } -         ints=0; -          for(intI=0; i<n;i++){ -             if(a[i]!=max&&a[i]!=min) +s+=A[i]; -         } +          Aprintf"%.2f\n",1.0*s/(n2)); at     } -     return 0; -}

1149:0 starting point algorithm 56--young singer Grand Prix _ jury rating

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.