18 .
.
. .
. , , , .
. , , , , .
. .
:
ϳ
.
1. .
2. .
3. .
4. .
5. ϳ .
6. .
!
1. .
2. 15 . .
ճ
.
.
1. .
2. .
.
: - -. .
, - , , .
г , . , program, procedure , :
procedure < >;
< > { }
Begin
< >
end;
. . . :
program < >;
< >;
{ }
< 1>;
< 2>;
Begin
< , :
1;
2;>
End.
. , ᳭ .
䳺 , . , , . .
, .
.
b . , ,
program 2;
var a, b, , s: real;
procedure Rectangular;
|
|
Begin
p:= 2*(a + b);
s:= a * b
end;
Begin
write (' a b ');
readln(a,b);
Rectangular;
writeln(p:6:2, s:6:2)
End.
a, b, p, s . , , . , , Rectangular , . , writeln, .
.
, , .
; . :
procedure <> ( >)
, , , var. , :
procedure Rectangular(a, b: real; var p, s: real);
Begin
p:= 2 * (a + b);
s:= a * b
end;
:
<> ( >)
, , , . , , .
̳ : , 볭 . .
, Rectangular
Rectangular(3, 4, , s);
:
= 14.0, s = 12.0.
ij . (Rectangular). ( 3 4) ( ) . , () (s). ( s) . ϳ , .
ϳ-.
( sin(), s(), ln(), (), bs() ) , -, (, ) :
function <>(< >): < >;
< >
Begin
< , : := >
End
, : - (-) - (- -). var.
. . .
|
|
ϳ-, (sin(x), cos(x) ),
. .
, : :
< >:= < >
( ) , :
<>(< >)
, Gryvni(25), , sin(x), cos(2*pi) .
ij . , , Gryvni. (, , ) . . (: ). , , -.
. 25 , 5,05 /.?
, :
function Gryvni(Dollars: integer): real;
Begin
Gryvni:= 5.05 * Dollars
end;
- Gryvni(25), , :