.


:




:

































 

 

 

 


,

1.

 

1970 . , . , .

 

 

. . , Object Pascal, ( Delphi).

 

. . , . : , , .

, , , . , .

, . , . , , .

 

. , , .

var a, b, sum: integer; { 1 }

begin { 2 }

readln(a, b); { 3 }

sum:= a + b; { 4 }

writeln('C ', a, ' ', b, ' ', sum); { 5 }

end. { 6 }

 

, ( , ).

1 . , , . var , a, b sum , , . , integer. , .

begin end, . .

3 readln. , . 5 writeln. , , . , 2 3, :

2 3 5

 

4 sum. , :=, .

 

, , , . . . . , . , (, ).

 

 

. :

, _;

0 9;

, +, *, { @;

: , .

(tokens), , :

;

();

;

;

(, , , ).

. , 128, Vasia, goto +. , , . . .

 

, . 1.1. .

 

1.1.

 

. (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F), $.

. , . . E e, . 10.

1.1 1,2 104 0,1 105. .

, . 1 , 256 . . MS-DOS ASCII, ( 0 127), ( 128 255) . 32 : , , , . :

1. , .

2. , #. , ( 1.1 #186 ).

3. , ^. . 64 , ( 1.1 ^M 13).

ASCII-, . , . 126 .


 

 

,

, , , . .

, :

( );

, ;

;

.

, Vasia, A, A13, A_and_B _____, 2late, Big gig S. , : , , , , . .

() , . , . , goto, var. , , .

, . . , ' ' <=, div. ( ) ( ).

 

, , . , , . . :

, ;

( ).

, , , ; , , , . . .


 

1.2.

 

1.2.

 

. , , . . , , , . , : .

, 1.2 , '. .

 

1

. boolean. 1 : true () false (). false 0 (), true 1.

. and, or, xor not ( 1.3). false 0, true 1.

 

1.3.

 

and ' ', . true, true.

or ( , ) true, true. , false or true true, true or true true.

xor , . , .

not , , . , not true false.

, 1.4. .

 

1.4.

 

 

. . , : , ( 1.5). ( ).

 

1.5.

. ( 1.6). ( ).

1.6.

 

, and, or, xor not. . : , , . . , 3 and 2 2, 3 11, 2 10.

shl shr. , , . , 12 shr 2 3, 12 shl 1, 1 , 24. , .

. , 1.7 ( ).

 

1.7.

:

1. .

2. .

3. : , .

:

.

:

:

 

:

 

. , . , . , 0,087 0,87 101, 0,87 1 ( , ).

, ( 1.8). , .

1.8.

 

 

. 1.8 .

 

comp , , , comp . . , 1.9. .


 

 

1.9.

 

, .

, . , /, div.

.

 

. , 1.10 ( ).

1.10.

, char, . 1 . (<, <=, >, >=, =, <>), . , . . ( 1.11).

1.11.

 

, , , . , :

;

Ord, ;

Pred Succ, ;

Low High, .

 

, .

 

. , :

_ (_)

:

integer ('A')

byte(500)

, , . : . , .


 

 

 

, , . .

, . , , , var. , :

var number: integer;

x, y: real;

option: char;

 

, . . .

.

, . , . const.

const number: integer = 100;

x: real = 0.02;

option: char = '';

, , .

. , . , . , . , .

, . , , . , . .

, .

not, , @.

: *, /, div, mod, and, shl, shr.

: +, , or, xor.

: =, <, >, <>, <=, >=, in.

, , . .

:

t + sin(x)/2 * x ;

a <= b + 2 ;

(x > 0) and (y < 0) .

: sin 2, x, t. , , and.

 

, .

 

program ; { }

begin

end. (* *)

 

, { } (* *). , . ; ( ).

. begin end , , . , .

: , , , , , . (, ..).

, , . uses, , , , :

uses crt, graph, my_module;

, : . . .

, . , . , :

const MaxLen = 100; g = 9.8;

koeff = 5;

. , , :

const weight: real = 61.5;

. , .

label, , . goto. , , 9999. :

. :

:=

:= . : , , :

<-

:

a:= b + c / 2;

b:= a;

a:= b;

x:= 1;

x:= x + 0.5;

 

: b:= a a:= b !

, , : .

( ). , .

 

-

. , , . .

 

read readln.

read();

readln[()];

. , . :

read(a, b, c);

readln(y);

readln;

, , . (, , ).

.

1. , .

2. , .

3. , .

, 3.78 real (3, '', 7 8) .

readln . , , . read . readln Enter.

, , . ,

var a: integer;

b: real;

d: char;

read(a, b, c). , , 2, b 3,78, c #. , , , c.

, :

readln(a, b);

readln(c);

. , . Enter (#13 #10). read, readln, , , , .

read(a); { }

write('? (y/n) ');

readln(c); { #13 }

, read readln.

, . write writeln.

write();

writeln[()];

write , writeln . writeln .

, , , . , , . , , :

writeln(' a = ', a:4, ' b = ', b:6:2, sin(a) + b);

( a b ). , . , , . a. , ( ).

, b. b , , , ( , ).

, ( ):

a = 2 b = 3.78 4.6892974268E+00

:

.

, , , , .

, . , '' , , '' .

, , . , . , .

, , . 17 , 10 .

.

 

.

. , : = 5/9 (F 32), C , F .

 

program temperature;

var fahr, cels: real; { 1 }

begin

writeln(' '); { 2 }

readln(fahr); { 3 }

cels:= 5 / 9 * (fahr 32); { 4 }

writeln(' : ', fahr:6:2, ' : ', cels:6:2); {5}

end.

 

. 1. fahr cels real. 2 . 3 readln. 4 , , cels. . .

1. , , , , . . , , .

 

 

2. .

 

 

3. .

 



<== | ==>
|
:


: 2018-10-18; !; : 397 |


:

:

, .
==> ...

1759 - | 1591 -


© 2015-2024 lektsii.org - -

: 0.191 .