:
1. .
2. .
3. .
1968 . . . 1985 . Borland Turbo Pascal 3.0. .
Turbo Pascal 4.0 . 5.0 . , VGA. Help.
6.0 - . . .
1992 . Turbo Pascal - 7.0. , , .
, . . Pascal (Object Pascal, Turbo Pascal, Delphi, PascalABC .). Pascal .
Pascal ABC, .. - . Pascal ABC . .. , .
, , . Pascal ABC Delphi Pascal , - .
.
, .
:
- A z,
|
|
(_), ,
;
- 0 1 2 3 4 5 6 7 8 9;
- : + * / = < >.,:; ^ $ # @;
- : [ ] () { };
- : <= >= <>.. (* *).
, , .
, , :
1. Program ;
2. 頠 uses ;
3. label ;
4. const ;
5. type ;
6. var ;
7. procedure ; function ;
8. begin end.
. ";" ( ). . begin, end. . "" , . :
1. ;
2. ;
3. .
. , , (). :
- , ;
- , , ;
- ; : x1 X1 - ;
- .
.
, .
. :
() : + -, , :
-10 +5 5
:
2.5 -3.14 2.
.
: true , false .
, (' '):
'Y' '' ' '.
.
- , . , , , . .:
|
|
' X:';
'='.
:
PROGRAM FIRST;
CONST
FAM = '';
KAF = '';
KURS = 1;
GRUP = 3;
.
, . , .
, , , , , .
var. . .
:
a: integer;
b: boolean;
c, b: real;
e: integer;
. , , - .
.
Pascal . PascalABC .
( ) , , , . , , .
:
.
:
type
Season = (Winter,Spring,Summer,Autumn);
DayOfWeek = (Mon,Tue,Wed,Thu,Fri,Sat,Sun).
,
a.. b,
a - , b - :
Var
k: 0..10;
p: 'a'..'n';
s: Mon..Sat.
, , .
real ( ). 8 , 15-16 -1.7∙10308.. 1.7∙10308. 5.0∙10-324. real , :
1.7;
0.013;
2.5e3 (2500);
1.4e-1 (0.14).
boolean ().
1 , True ( - 1) False ( - 0).
.
, . .
{ }, (**)
// ( ). .
.
- , . BEGIN. 2 :
1) , ;
2) , .
:
1) ;
2) ;
3) ( );
:
1) ;
2) .
|
|
.
, . :
1) (, , ) ();
2) , .
. . :
Read ( );
Readln ( ).
- , .
:
Read(number);
Readln(X,Y).
(, , ). . :
Write ( );
Writeln ( ).
- () , .
:
Writeln(': ',,,,D);
Write(number,X).
writeln . write writeln :
Write (a:5:2);
, . .
.
- . .
:
:= ;
, . :
a:=1000;
b:=5;
a:=a+b.
.
, , . . 6 , , , (.). , .
.
1 | * | |
/ | ||
div | 2 | |
mod | 2 | |
2 | + | |
- |
div mod .
, . .
.
| x | | abs(x) | x | Integer (I) Real (R) |
x 2 | sqr(x) | x | I R, R |
sin x cos x arctg x | sin(x) cos(x) arctan(x) | I R, R | |
ex ln x | exp(x) ln(x) | I R, R | |
sqrt(x) | x | I R, R | |
trunc(x) | , | R, I | |
frac(x) | R | ||
round(x) | R, I |
|
|
and, or xor, not. boolean boolean. , boolean, ().
. ,
.
and ( , , &, ^, ""). a & b true , a b true, false:
true and true = true;
true & false = false;
false ^ false = false.
or ( , , +, v, ""). a + b false , a b false, true:
true or true = true;
true + false = true;
false v false = false.
a xor b (" "). false , a b , true.
not ( ,, −, "").
not a , a:
not true = false;
false = true.
. : a<b, c>=d, x=y .. ():
= ;
<> ;
< ;
> ;
<= ;
>= .
:
1) ;
2) ;
3) (
);
4) .
, , Pascal.
, , .
program first; //
uses crt; //
var x, y, s:integer; //
begin //
writeln( ); //
readln(x,y); //
//
s:=x+y; //
//
writeln( =,s); //
//
end. // .