, .
begin end. , . end , begin ( ).
.
begin i:= 2; k:= i / 5 end;begin end . . end . .
, , . , , , . , , .
. , , .
. .
. , .
, .
integer -32768 32767. Pascal (byte, longint).
real () .
() (boolean) - true (1, ) false (0, ).
(char) .
. .
, . .
. , , .
, .
. 255 . Pascal.
, , . .
, .
Pascal , (, ).
|
|
. , .
.
. Pascal
, | ||
shortint | -128127 | |
integer | -32 76832 767 | |
longint | -2 147 483 6482 147 483 647 | |
byte | 0255 | |
word | 065 535 |
. :
a, b, c: integer;
a, b, c - , integer . , a, b, c, , .
. ,
+ | |
- | |
* | |
div | ( ). ( ). |
mod | ( ). : a mod b = a ((a div b) * b). |
, ( ) ( ) . , maxint, integer. :
(a b) <= maxint, a <= maxint, b <= maxint.
, , (). boolean true (), false ().
.
= | |
<> | |
>= | |
> | |
<= | |
< |
Pascal.
. Pascal,
abs(x) | x ( x) | |
sqr(x) | x | |
succ(x) | x (x+1) | |
pred(x) | x (x-1) | |
random(x) | 0..x-1. | |
sin(x) | x ( ) | |
cos(x) | x ( ) | |
arctan(x) | x ( ) | |
ln(x) | x | |
exp(x) | x | |
sqrt(x) | x | |
odd(x) | true, x ; false . |
random , . . randomize.
|
|
inc dec . , ( inc) ( dec) , . , inc(x,2) x+2. , ( inc) ( dec) . , dec(x) x-1. , :
trunc(x) ;
round(x) .
- Pascal
read() readln(), - write() writeln(). , ln, .
, (Enter). .
read() readln(). read(), . readln() Enter. . .
var a,b,c,d: integer; begin read(a); // a -> <space> or <tab> or <enter> -> b read(b); writeln(a,' ',b); readln(c); // c -> only <enter> -> d readln(d); writeln(c,' ',d); read(a,b); // a -> <space> or <tab> or <enter> -> b writeln(a,' ',b); readln(c,d); // c -> <space> or <tab> or <enter> -> d writeln(c,' ',d); end.:
1. http://pas1.ru/programming
2. http://pascalabc.net/downloads/pabcnethelp/index.htm ( , Pascal)
http://new.bacs.cs.istu.ru/
_21_Pascal
_21__1 5 .
.
Pascal, .
( )
( http://life-prog.ru/view_algoritmleng.php?id=88), integer, , .
, Input Output .