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;
}
}
}
}