Vanya_Shestakov

Untitled

Mar 1st, 2021 (edited)
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.52 KB | None | 0 0
  1. type
  2.     TPatient = record
  3.         Surname: string[20];
  4.         Sex: Char;
  5.         Age: Byte;
  6.         Diagnosis: string[20];
  7.         City: string[20];
  8.     end;
  9.  
  10. var
  11.     Patient: TPatient;
  12.  
  13.  
  14.  
  15. Patient.Surname := 'Хромов';
  16. Patient.Sex := 'М';
  17. Patient.Age := 35;
  18. Patient.Diagnosis := 'Перелом ноги';
  19. Patient.City := 'Минск';
  20.  
  21. with Patient do
  22. begin
  23.     Surname := 'Хромов';
  24.     Sex := 'М';
  25.     Age := 35;
  26.     Diagnosis := 'Перелом ноги';
  27.     City := 'Минск';  
  28. end;
  29.  
  30. var
  31.     ArrOfPatients: array of TPatient;
  32.  
  33.  
  34. for I := 0 to High(ArrOfPatients) do
  35. begin
  36.     Writeln(ArrOfPatients[I].Surname);
  37.     Writeln(ArrOfPatients[I].Sex);
  38.     Writeln(ArrOfPatients[I].Age);
  39.     Writeln(ArrOfPatients[I].City);
  40.     Writeln(ArrOfPatients[I].Diagnosis);
  41. end;
  42.                
  43.  
  44. function InputAmount(): Integer; forward;
  45. procedure InputData(var People: TPeople); forward;
  46. function FindEldest(People: TPeople): TPeople; forward;
  47. procedure ShowPeople(People: TPeople); forward;
  48.  
  49.  
  50.  
  51. type
  52.     TypeAuto = (Cargo, Passenger);
  53.     TAuto = record
  54.         Country: string[20];
  55.         Brand: string[20];
  56.         case Type: TypeAuto of
  57.             Cargo: (CarryingСapacity: Integer;);
  58.             Passenger: (NumOfPassengers: Integer;);
  59.     end;
  60.  
  61.  
  62. var
  63.     Auto, AutoCarg: TAuto;
  64. begin
  65.     Auto.Country := 'Германия';
  66.     Auto.Brand := 'Мерседес';
  67.     Auto.Type := Passenger;
  68.     Auto.NumOfPassengers := 3;
  69.  
  70.     AutoCarg.Country := 'Беларусь';
  71.     AutoCarg.Brand := 'МАЗ';
  72.     AutoCarg.Type := Cargo;
  73.     AutoCarg.CarryingСapacity := 15;
  74. end.
  75.  
Add Comment
Please, Sign In to add comment