Question: English songs Contest (acm)

Source: Internet
Author: User

Print? English songs contest
Time limit (Common/Java): 1000 MS/10000 MS running memory limit: 65536 KByte
Total submissions: 3004 pass the test: 1208
Description
We have already learned what kind of person yuanzi is in the question of "yuanzi Number". During his freshman year, he participated in the "English Jule Department" of the Business College ". Tell you a secret. This club is a good place. It will not only have a wonderful activity but also contain MM.
This is not the case. The English Club held a program called the English kingsong competition. Many people participated in this program. No, I got my score. yuanzi was brave and volunteered to calculate the total score.
At that time, there were 7 judges, each of which had to score the contestants. Now I want to remove the highest score and the lowest score, and then calculate the average score. The result is accurate to the second decimal point.
Input
The test data includes multiple instances.
Each group of data includes seven real numbers, representing the score of the contestant. The player name is followed by a name of no more than 30 characters.
Input until the end of the file.
Output
Calculate the name and final score of each contestant, and keep two decimal places in the result.
Sample Input
10 10 10 10 10 10 9 xiaoyuanwang
0 0 0 0 0 0 beast
Sample output
Xiaoyuanwang, 10.00
Beast0.00

English songs contest
Time limit (Common/Java): 1000 MS/10000 MS running memory limit: 65536 KByte
Total submissions: 3004 pass the test: 1208
Description
We have already learned what kind of person yuanzi is in the question of "yuanzi Number". During his freshman year, he participated in the "English Jule Department" of the Business College ". Tell you a secret. This club is a good place. It will not only have a wonderful activity but also contain MM.
This is not the case. The English Club held a program called the English kingsong competition. Many people participated in this program. No, I got my score. yuanzi was brave and volunteered to calculate the total score.
At that time, there were 7 judges, each of which had to score the contestants. Now I want to remove the highest score and the lowest score, and then calculate the average score. The result is accurate to the second decimal point.
Input
The test data includes multiple instances.
Each group of data includes seven real numbers, representing the score of the contestant. The player name is followed by a name of no more than 30 characters.
Input until the end of the file.
Output
Calculate the name and final score of each contestant, and keep two decimal places in the result.
Sample Input
10 10 10 10 10 10 9 xiaoyuanwang
0 0 0 0 0 0 beast
Sample output
Xiaoyuanwang, 10.00
Beast0.00

 

[Plain]
# Include <stdio. h>
 
Void sort (float score []); // sort
 
Int main ()
{
Int I;
Char name [30];
Float num [7];
Float sum;
Float average;
 
While (scanf ("% f", & num [0])! = EOF)
{
Sums = 0.0;
 
For (I = 1; I <7; I ++)
{
Scanf ("% f", & num [I]);
}
Scanf ("% s", name );

Sort (num );
 
For (I = 1; I <6; I ++)
{
Sum + = num [I];
}
 
Average = sum/5;
 
Printf ("% s % 0.2f \ n", name, average );
}
}
 
Void sort (float score [])
{
Int I;
Int j;
Float t;
 
For (I = 0; I <7; I ++)
{
For (j = I; j <7; j ++)
{
If (score [I]> score [j])
{
T = score [I];
Score [I] = score [j];
Score [j] = t;
}
}
}
}

# Include <stdio. h>

Void sort (float score []); // sort

Int main ()
{
Int I;
Char name [30];
Float num [7];
Float sum;
Float average;

While (scanf ("% f", & num [0])! = EOF)
{
Sums = 0.0;

For (I = 1; I <7; I ++)
{
Scanf ("% f", & num [I]);
}
Scanf ("% s", name );

Sort (num );

For (I = 1; I <6; I ++)
{
Sum + = num [I];
}

Average = sum/5;

Printf ("% s % 0.2f \ n", name, average );
}
}

Void sort (float score [])
{
Int I;
Int j;
Float t;

For (I = 0; I <7; I ++)
{
For (j = I; j <7; j ++)
{
If (score [I]> score [j])
{
T = score [I];
Score [I] = score [j];
Score [j] = t;
}
}
}
}



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.