Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Pupil=Record
- f,i,o:string[20];
- date,month:byte;
- year:word;
- Gender:boolean;
- end;
- Function LT(s1,s2:Pupil):boolean;
- Var i1, i2: Integer;
- begin
- if (s1.year <> s2.year);
- LT := (s1.year > s2.year)
- else
- if (s1.month <> s2.month);
- LT:=(s1.month > s2.month)
- else
- LT:=(s1.date > s2.date);
- end;
- Type MyArray=array[1..17] of Pupil;
- Procedure Proc(Var a:MyArray);
- Var h,i,j:byte; temp: string;
- begin
- h := Length(a);
- for i:=1 to h do
- for j:=h downto i+1 do
- if LT(a[i],a[j]) then
- begin
- temp:=a[j];
- a[j]:=a[i];
- a[i]:=temp;
- end;
- end;
- Function IO(s1:string):pupil;
- Var c:Imteger;
- с:=pos(' ',s1);
- IO.i:=copy(s1, 1, c-1);
- Delete(s1, 1, c-1);
- c:=pos(' ',s1);
- IO.o:=copy(s1, 1, c-1);
- Delete(s1, 1, c-1);
- c:=pos(' ',s1);
- IO.f:=copy(s1, 1, c-1);
- Delete(s1, 1, c-1);
- с:=pos('/',s1);
- val(copy(s1, 1, c-1),IO.date);
- Delete(s1, 1, c-1);
- с:=pos('/',s1);
- val(copy(s1, 1, c-1),IO.month);
- Delete(s1, 1, c-1);
- с:=pos(' ',s1);
- val(copy(s1, 1, c-1),IO.year);
- Delete(s1, 1, c-1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement