.


:




:

































 

 

 

 





, write, writeln

write writeln , . writeln write , .

:

Begin

Writeln (Privet!);

End.

% 1

,

:

Begin

Writeln (Privet: 8);

End.

8, , , , write. , , :

    P r i v e t

, .

 

 

% 1

.

*******************

* *

* *

* *

*******************

- , .

- , .

- , .

% 2

, *, . . .

 

% 3

, -

write , . , .

^ X^Y
* X*Y
/ X/Y
+ X+Y
- X-Y
DIV X\Y; 10\4 (: 2)
MOD X MOD Y 10 MOD 3 (: 1)
SQR SQR (9) (: 81)
SQRT SQRT(36) (: 6)

 

, : +, -, *

:

Writeln (1 + 2 + 3);    
Writeln (Summa = , 1 +2 + 3);   Summa = 6

:

, .

:

Writeln (a, b, c):

Writeln (a:6, b:3, c:1,2); (:1,2 )

% 1 ()

, . :

- ,

- ,

.

% 2

1 = 1

1 + 2 = 3

1 + 2 + 3 = 6

1 + 2 + 3 + 4 = 10, , , , .

% 3

, , , , .

1 = 1

1 + 2 = 3

1 + 2 + 3 = 6

1 + 2 + 3 + 4 = 10

% 4

3 , ( 6 0):

1 = 1

1 + 2 = 3

1 + 2 + 3 = 6

1 + 2 + 3 + 4 = 10

% 5

, , , , .

1 = 1! 1 = 1

1 + 2 = 3! 1*2 = 2

1 + 2 + 3 = 6! 1*2*3 = 6

1 + 2 + 3 + 4 = 10! 1*2*3*4 = 24

 

* .

.

() , , .. .

:

Integer -

Real -

String -

Boolean

:

var

:

Var

a:integer;

b:real;

: 23 48. 23 + 48 = 71

Var a,b: integer; begin a:= 23; b:= 48; writeln (23 + 48 = , 23+48); end.   := -

% 1

, 25 34, .. :

34 25 = 9

34 + 25 = 59

34 * 25 = 850

% 2

, 24 13. , . .

 

:

Integer -

Real -

String -

Boolean

integer. . real.

% 1

18 9. 18: 9 = 2

% 2

582 39. 582: 39 = 14, 92

% 3

249 123. $.

 

DIV X\Y; 10\4 (: 2)
MOD X MOD Y 10 MOD 3 (: 1)

 

div mod , integer.

% 1

Ø 5 + 5 div 5

Ø 5 div 5 div 5

Ø 123 div 10

Ø 123 mod 10

Ø 123 div 10* 10

Ø 123 * 10 div 10

% 2

Ø 243 15

Ø 15 4 18

Ø 13 2, 14 3.

read

read. .

:

Var a, b,c, P: integer;

Begin

Writeln ( );

Readln(a, b, c);

P:= a + b+ c;

Writeln ( , P);

End.

% 1

. .

% 2

. .

% 3

. .

% 4

. .

% 5

, , . :

************ *A = 5 * *B = 2 * *A + B = 7 * *A B = 2 * *A * B = 10 * ************

 

% 6

, .

% 7

, 30 . . .

Ifthen

If:

If then ; : If a>0 then writeln (`a>0`);     If then 1 else 2; : If a>0 then writeln (`a>0`) else writeln (`a<0`);  

%

%

%

%

%

%

%

%

%

%

%

%

%

% 6()

% 1

, . .

% 2

, 30 . , . .

% 3

.

% 4

, , , 17 , 17.

% 5

, , , . ( 3600).

% 6

 

%

%

%

%

%

. , .

 

. , , .

, 100 . ? , .

100 100 . , , : var n1,n2,n3,n4,n5, n6,n7,..., n100: Integer; .

.

- , , , , , . ( ). ? - . : , , , .

- var . - : ; Array, ""; . - [ ]. , , e: ... of;

- , .
, , ().
:
1. ( , ).
2. () .
3. , .
() -
( ):
A[7] i:=7; A[i]
i - ,
() - , m*n. : i=1..m j=1..n
:
a[3,9]=8; B:=A[1,1]
A[i,j,k]. , , 3, , , , .


:
1. (by nserton)
2. (by Selecton)
3. (by Exchange) .
( ) ()
I.
: . () . , .
:
1. ,
2. , .
3. , ().
:
1) , , ;
2) , , , , . , . , , , .
II.
: . - . ( ) . 1. , n-1 ( )
III. ()
: . , . n-1 .

Program N1;

var M: Array [1..100] of Integer; A: Real; I: Byte;

begin Randomize;

For I:= 1 to 100 do M[I]:= Random(500);

For I:= 1 to 100 do

A:= A + M[I];

A:= A / 100;

Write(' : ', A);

end.





:


: 2017-02-11; !; : 685 |


:

:

, .
==> ...

1798 - | 1678 -


© 2015-2024 lektsii.org - -

: 0.044 .