:
Program < >;
[ ]
Begin
[ ]
End.
.
< > , [ ] , .
, : , , , , , . : , , .
;.
, , ( ) .
, . , , , .
: D, A1, gamma, delta, v3f.
, Dd, DD dd .
.
.
, .
integer
real
char
string
boolean
, , .
. Integer MaxInt MaxInt, MaxInt . Byte 0..255. Char . String 0 255 ( , ()). Boolean True () False ().
( boolean) .
|
|
, , , , .
, , .
, . .
Const
Type
Var
:
<1>=<1>;
[<2>=<2>;]
<1>=< 1>;
[<2>=< 2>;]
<11>[,<12>, ]:<1>;
[<12>[,<22>, ]:<2>;]
Program prim01;
Const
H=4.3;
Var
A,b,c:integer;
X:f;
. (, , ), , .
:
< >:=<>;
.
Program prim02;
Var
A,b,c:integer;
Begin
A:=4;
b:=a+3;
c:=a+b
End.
.
:
Read[(< >)];
ReadLn[(< >];
Ln , .
, .
Write[(< >)];
WriteLn[(< >];
Ln , .
, .
. , .
Program prim03;
Var
b,c:integer;
v:real;
Begin
Write('b=');
Readln(b);
Write('c=');
Readln(c);
v:=(b+c)/3.56;
Writeln('v=',v:6:2)
End.
v 6 , , 6.
: .
|
|
1.
If < > then <1> else <2>;
, 1, 2.
2.
If < > then <>;
, , . , , True False .
, , begin end. , , begin end .
+ | ||
- | ||
* | ||
/ | 5.0/2.0 = 2.5 | |
div | ( ) | 5 div 2 = 2 |
mod | 5 mod 2 = 1 | |
abs(x) | ( ) | abs(-2) = 2 |
sqr(x) | sqr(2) = 4 | |
sqrt(x) | sqrt(4) = 2.0 | |
pi | ~ 3.14... |
sin(x) | sin(pi) = 0 | |
cos(x) | cos(0) ~ 1.0 |