Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. type Pupil=Record
  2. f,i,o:string[20];
  3. date,month:byte;
  4. year:word;
  5. Gender:boolean;
  6. end;
  7.  
  8. Function LT(s1,s2:Pupil):boolean;
  9. Var i1, i2: Integer;
  10. begin
  11. if (s1.year <> s2.year);
  12. LT := (s1.year > s2.year)
  13. else
  14. if (s1.month <> s2.month);
  15. LT:=(s1.month > s2.month)
  16. else
  17. LT:=(s1.date > s2.date);
  18. end;
  19. Type MyArray=array[1..17] of Pupil;
  20. Procedure Proc(Var a:MyArray);
  21. Var h,i,j:byte; temp: string;
  22. begin
  23. h := Length(a);
  24. for i:=1 to h do
  25. for j:=h downto i+1 do
  26. if LT(a[i],a[j]) then
  27. begin
  28. temp:=a[j];
  29. a[j]:=a[i];
  30. a[i]:=temp;
  31. end;
  32. end;
  33. Function IO(s1:string):pupil;
  34. Var c:Imteger;
  35. с:=pos(' ',s1);
  36. IO.i:=copy(s1, 1, c-1);
  37. Delete(s1, 1, c-1);
  38. c:=pos(' ',s1);
  39. IO.o:=copy(s1, 1, c-1);
  40. Delete(s1, 1, c-1);
  41. c:=pos(' ',s1);
  42. IO.f:=copy(s1, 1, c-1);
  43. Delete(s1, 1, c-1);
  44. с:=pos('/',s1);
  45. val(copy(s1, 1, c-1),IO.date);
  46. Delete(s1, 1, c-1);
  47. с:=pos('/',s1);
  48. val(copy(s1, 1, c-1),IO.month);
  49. Delete(s1, 1, c-1);
  50. с:=pos(' ',s1);
  51. val(copy(s1, 1, c-1),IO.year);
  52. Delete(s1, 1, c-1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement