Help implement the Perl task solution:
At the entrance to the program, information is given about the passing of examinations by students of the 9th grade of a certain secondary school. The first line reports the number of students N, which is not less than 10, but not more than 100, each of the following N lines has the following format: <Last name> <First name> <rating>, where <Last Name> is a line consisting of no more than 20 characters, <Name> - a string consisting of no more than 15 characters, <estimates> - three integers separated by a space, corresponding to the estimates of a five-point system. <Last Name> and <First Name>, as well as <First Name> and <assessment> are separated by a single space. Example of an input line: Ivanov Peter 4 5 3 You need to write a program as efficient as possible (indicate the version of the programming language used, for example, Borland Pascal 7.0), which will display the names and names of the three worst average students. If among the rest there are students who have scored the same average score as one of the three worst, then their names and surnames should be derived.
I am stuck at work with the lines themselves, I understand that it is necessary to use hashes, where the first and last names will be keys, and the average score value, but I can’t think how to do this with a minimum of gestures. The function to calculate the average score:
sub GPA { my @balls = @_ ; my $sum = 0; foreach my $item(@balls){ $sum += $item; } return $sum/scalar @balls; }
perlto translate work will not be - ikoolik