Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {Волкович Максим (volkovcih.maksim.s@gmail.com), 112гр., v1.0,
- описать процедуру моложе(гр,d), которая подсчитывает количество женщин из группы Гр, родившихся позже d}
- program t_13_24_a_v1 (input, output);
- type str=packed array[1..16] of char;
- date=record day:1..31; month: 1..12; year:1..maxint end;
- quest=record surname: str; sex: (male,female); birthday:date end;
- group = array [1..25] of quest;
- function younger(gr:group;d:date):integer;
- var i,j:integer;
- begin
- j:=0;
- for i:=1 to 25 do
- if (gr[i].sex=female) and ((gr[i].birthday.year>d.birthday.year) or ((gr[i].birthday.year=d.birthday.year) and (gr[i].birthday.month>d.birthday.month)) or
- ((gr[i].birthday.year=d.birthday.year) and (gr[i].birthday.month=d.birthday.month) and (gr[i].birthday.day>d.birthday.day))) then k:=k+1;
- end;
- var gr112:group; f:date;
- begin
- read(f.day,f.month,f.year);
- younger(gr112,f);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement