fork download
  1. program Project2;
  2.  
  3. type
  4. Pupil = record
  5. age: Integer;
  6. secondName: string;
  7. end;
  8.  
  9. var
  10. i : Integer;
  11. pupils: array [1..15] of Pupil;
  12. newPupil : Pupil;
  13. begin
  14. for i := 1 to 15 do begin
  15. ReadLn(pupils[i].secondName);
  16. ReadLn(pupils[i].age);
  17. end;
  18.  
  19. ReadLn(newPupil.secondName);
  20. ReadLn(newPupil.age);
  21.  
  22. for i := 1 to 15 do
  23. if (pupils[i].age <= newPupil.age) then begin
  24. WriteLn(pupils[i - 1].secondName);
  25. break;
  26. end
  27. end.
  28.  
Success #stdin #stdout 0s 280KB
stdin
Иванов
180
Крылов
179
Пяткин
178
П
177
В
176
Г
175
С
174
ЗЗ
173
ЗСМ
172
ВАВ
171
ВРА
170
ОРП
169
ОРПЕ
168
ВПРОВАПР
167
ОЛРЫВЛР
164
НОВЫЙ
168 
stdout
ОРП