type Man = record
name: String;
surname: String;
date: record
day: Integer;
month: Integer;
year: Integer;
end;
var people: Array [1..100] of Man;
i,n,_year: Integer;
_name: String;
begin
Write('Enter number of man: ');
ReadLn(n);
for i := 1 to n do
With people[i] do
WriteLn('Man[',i,']:');
Write('Enter name: ');
ReadLn(name);
Write('Enter surname: ');
ReadLn(surname);
Write('Enter birthday Day/Month/Year: ');
ReadLn(date.day, date.month, date.year);
WriteLn;
Write('Enter year: ');
ReadLn(_year);
if (date.year = _year) then
WriteLn('Name: ',name,' Surname: ',surname);
ReadLn(_name);
if (name = _name) then
Write(surname,' ',name);
WriteLn(' ',date.day,'.',date.month,'.',date.year);
ReadLn;
end.
Объяснение:
type Man = record
name: String;
surname: String;
date: record
day: Integer;
month: Integer;
year: Integer;
end;
end;
var people: Array [1..100] of Man;
i,n,_year: Integer;
_name: String;
begin
Write('Enter number of man: ');
ReadLn(n);
for i := 1 to n do
With people[i] do
begin
WriteLn('Man[',i,']:');
Write('Enter name: ');
ReadLn(name);
Write('Enter surname: ');
ReadLn(surname);
Write('Enter birthday Day/Month/Year: ');
ReadLn(date.day, date.month, date.year);
WriteLn;
end;
Write('Enter year: ');
ReadLn(_year);
for i := 1 to n do
With people[i] do
if (date.year = _year) then
WriteLn('Name: ',name,' Surname: ',surname);
WriteLn;
Write('Enter name: ');
ReadLn(_name);
for i := 1 to n do
With people[i] do
if (name = _name) then
begin
Write(surname,' ',name);
WriteLn(' ',date.day,'.',date.month,'.',date.year);
end;
ReadLn;
end.
Объяснение: