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

PROGRAMMING:The linked list is also simple

Luz5年前 (2021-05-10)题库421
Make a linked list of students' grade points. The linked list structure is as follows:
struct student {
string name; // Student name
double gpa; // GPA
student *next;
};
Input is the name and grade point of a group of students, stored in the form of linked list. Delete the student node whose grade point is less than the average grade point to become a new linked list. Then according to the order of input, output the student information of the new linked list in order. GPA is the arithmetic mean of all the student grade points entered.
###Input format:
The input consists of several lines. Each line is a student's name and grade point, separated by spaces.
The last line is - 1.
###Output format:
The output includes the name of the student. One line for each student's name.
###Input example:
```in
zhang 3.5
liu 2.1
tie 1.9
-1
```
###Output example:
```out
zhang
```






answer:If there is no answer, please comment