Advertisement
volkovich_maksim

t_13_24_b_full_volkovich

Nov 21st, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.05 KB | None | 0 0
  1. {Волкович Максим (volkovcih.maksim.s@gmail.com), 112гр., v1.0,
  2. описать процедуру моложе(гр,d), которая подсчитывает количество женщин из группы Гр, родившихся позже d}
  3. program t_13_24_a_v1 (input, output);
  4. type str=packed array[1..16] of char;
  5.      date=record day:1..31; month: 1..12; year:1..maxint end;
  6.      quest=record surname: str; sex: (male,female); birthday:date end;
  7.      group = array [1..25] of quest;
  8. function younger(gr:group;d:date):integer;
  9.      var i,j:integer;
  10.      begin
  11.        j:=0;
  12.        for i:=1 to 25 do
  13.          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
  14.              ((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;
  15.      end;
  16. var gr112:group; f:date;      
  17. begin
  18.      read(f.day,f.month,f.year);
  19.      younger(gr112,f);
  20. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement