Даны следующие типы данных: type date = record day : 1..31; mounth : 1..12; year : integer; end; person = record surnamename : string; birthday : date; end; listofpeople = array [1..50] of person; напишите программу, которая вводит с клавиатуры данные о n лицах(n< =50) и выводит на экран: фамилию и имя самого младшего человека

xPinkiPai xPinkiPai    1   08.06.2019 06:20    2

Ответы
cvetaharlanova5 cvetaharlanova5  07.07.2020 14:54
Program Pro1;
type Date = record 
day : 1..31; 
mounth : 1..12; 
year : integer; 
end; 
Person = record 
SurnameName : string; 
Birthday : date; 
end; 
ListOfPeople = array [1..50] of person;
var
People: ListOfPeople;
JoungHuman: Integer;
i, JoungHumanIndex: Byte;
begin
for i:=1 to 50 do
begin
Write('Human '+IntToStr(i)+':')
Write('Input Surname and Name:')
ReadLn(People[i].SurnameName);
Write('Input Birthday date(day, mounth, year):')
Read(People[i].Birthday.day, People[i].Birthday.mounth, People[i].Birthday.year);
end;

//
JoungHumanIndex:=1;
//
JoungHuman:=People[1].Birthday.day + People[1].Birthday.mounth*13 + People[1].Birthday.year * 32 * 13;

for i:=2 to 50 do
if JoungHuman> People[i].Birthday.day + People[i].Birthday.mounth*13 + People[i].Birthday.year * 32 * 13 then
begin
//
JoungHumanIndex:=i;
//
JoungHuman:=People[i].Birthday.day + People[i].Birthday.mounth*13 + People[i].Birthday.year * 32 * 13;
end;

WriteLn('Most joung human: '+People[JoungHumanIndex].SurnameName);
end.
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика