Вы находитесь на странице: 1из 6

11-12.

,
, . ,
() .
, .
:
< >= record < > end;

< > ;
record, end ;
< > ;
, .

()
(), :
Type
Birthday=record
day, month: byte;
year

: word;

end;
var
a,b: Birthday;
...

Birthday ( )
day, month year (, ); a, b
Birthday.
,
,
79

A:=b;

,
, .. ,
:
a.day:=27;
b.year:=1939;

:
var
c: record
name : string;
bd

: Birthday;

end;
...
if c.bd.year=1939 then ...

WITH

(),
.
WITH - .
.

WITH -

DO

DO
, .
:

80

gl.price := 200;
with gl do
begin
price := 200;
number := 10
end;

with ,
.
. .
, 20
,
.
.
program store;
const Max_n = 100;
type
str20 = string [20];
goods = record
name

: str20;

price

: real;

number : integer;
end;
var stock

: array[l..Max_n] of goods;

i, j, len

: integer;

name

: str20;

found

: boolean;

count

: integer;

begin
write(' : ');
readln(count);
for i:=1 to count do begin
writeln( ., -);

81

with stock[i] do
readln(name, price, number);

end.

.
, , ,

.
:

n1 ;
n ;
student ,
fam, fiz, mat, pr ss;
fam , ;
fiz, mat, pr , ,
;

ss , ;
ved , student;
sg ;
i ved;
:
program stud;
const n1=30;
type student=record
fam:string[10];
fiz,mat,pr:integer;
ss:real;
end;
var

ved:array[1..n1] of student;
i,n:integer;

82

sg:real;
begin
writeln(' ?');
read(n);
for i:=1 to n do
with ved[i] do
begin
writeln(' ');
read(fam);
writeln('

');

read(fiz,mat,pr)
end;
sg:=0;
for i:=1 to n do
with ved[i] do
begin
ss:=(fiz+mat+pr)/3; {

}
sg:=sg+ss;
end;
sg:=sg/n;{ }
writeln(' ');
write('!

writeln('! cp.

!');

!')

for i:=1 to n do
with ved[i] do
begin
write('!',fam:10,'!',fiz:10,'!',mat:10,'!',pr:10);
writeln('!',ss:10:2,'!');
end;
writeln(' =',sg);
end.

,
. ,
, ,
83

, sex ( ),
:
;
, ;
:
.

. ,
case. :
type personsex=(male,female);
person = record
name,secondname,surname : string[20];
birthday : date;
case sex : personsex of
male : ( army1 : date;
army2 : string[20]);
female : (flower : srting[20]);
end;

,
,
, .. ""
.

84

Оценить