-->
当前位置:首页 > 题库

PROGRAMMING:Group rating

Luz5年前 (2021-05-10)题库433
Fill in the blanks. Please add the following code to complete the title requirements( Note: need to submit full code)
There is a team of five people. Each of them gave a score to the instructor, removed the highest score, removed the lowest score, and the average of the remaining three scores was the team's score to the instructor.

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] grade = new int[5];
for(int i=0; i< grade.length; i++){
grade[i] = in.nextInt();
}
RR rr = new RT(grade);
double dd = rr.mark();
System.out.printf("%.2f",dd);
}
}
abstract class RR{
int[] grade;
public RR(int[] grade){
this.grade = grade;
}
public abstract double mark();
}
class RT extends RR{
}

###Input format:
Give 5 positive integers (arranged from small to large) with no more than 10 in a row.
###Output format:
Output collective score, keep two decimal places.
###Input example:
```in
1 2 4 6 9
```
###Output example:
```out
four
```






answer:If there is no answer, please comment