.


:




:

































 

 

 

 





:

1. ?

2. , ?

3. while?

4. while, false?

5. for while?

 

:

1. n, m. n m.

2. n. .

3. n. , n .

4. x, . .

5. x, . .

6. x. : . , k- , : .

7. . : . (), .

8. , .

9. n. , n.

10. .

11. : . , k- , : .

12. n. n , , m- .

13. , 120 240, , .

14. n. 1,,n , .

15. m>1. n, .

16. n. a,b,c, ( ).

17. n (). , .

18. .

19. x, . .

20. , .

 

:

:

1. .., .., .. . - .: , 1988. - 320 .

2. .., .. . - .: , 1987. - 112 .

3. . ./. . .: , 1989. - 360 .

4. . . - .: , 1982. - 382 .

5. ., ., . Delphi: . . - : ., 1995. - 608 .

6. , .. Delphi: . .- .: , 1995. - 464 .

7. .. Delphi : - .: . - 316 .

:

1. .. . - .: , 1988. - 224 .

2. .. : . . - .: , 1989. - 160 .

3. . : . . - .: , 1987. - 232 .

4. . Windows: 2 .; . . - .: , 1993. - 536 .

5. .. . 3- . 1. . - .: .-. - , 1992. - 304 .

6. .. Windows. - .: .-. - , 1994. - 539 .

 

:

( While ) :

while <> do <>;

: , . : , . , .. . , (.. , begin... end).

, while:

var i,sum: integer;

begin

sum:=0; i:=0;

while i<100 do begin

i:=i+1;

sum:=sum+i;

end;

writeln(' =',sum);

readln;

end.

: ( ) 0,2.

A ; B ;

H .

-     - 1- 2- : ; b ; h 3- , , 4- , 5- 6- 7-

program PR2;

uses crt;

var a, b, h, x, y: real;

begin

clrscr;

writeln ( a, b, h);

read (a, b, h);

b:=b+h;

while (a<=b) do begin

x:=a;

a:=a+h;

y:=(x*x*x)-3*x+1;

writeln (x=,x:3:1, y=,y:3:3);

end;

end.

7

:

1. .

2. ? ?

3. ?

4. ?

5. ? ?

6. ?

7. ?

 

:

1. . , , .

2. , .

3. , .

4. . , [-1,1] .

5. . : .

6. , [ ]. , , , .

7. . , , .

8. k k!.

9. . , , , .

10. . .

11. . , 50, 100.

12. . X Y, Y X.

13. , , .

14. , , .

15. . , , .

16. . , ; , , .

17. . , , , .

18. . , . c .

19. , . , .

20. . i, j, k, , . , .

 

:

:

1. .., .., .. . - .: , 1988. - 320 .

2. .., .. . - .: , 1987. - 112 .

3. . ./. . .: , 1989. - 360 .

4. . . - .: , 1982. - 382 .

5. ., ., . Delphi: . . - : ., 1995. - 608 .

6. , .. Delphi: . .- .: , 1995. - 464 .

7. .. Delphi : - .: . - 316 .

:

1. .. . - .: , 1988. - 224 .

2. .. : . . - .: , 1989. - 160 .

3. . : . . - .: , 1987. - 232 .

4. . Windows: 2 .; . . - .: , 1993. - 536 .

5. .. . 3- . 1. . - .: .-. - , 1992. - 304 .

6. .. Windows. - .: .-. - , 1994. - 539 .

 

:

, , . , . . :

var a: array [1..10] of real;

a real, , a[< >].

, ( , , ).

, . . . , array .

:

Type =array[1..n] of ;

Var :;

, . , , . , 64 . :

:: X() (n=20) .

  program max; type mas=array[1..20]of integer; var A: mas; i: byte; max: integer; begin { } for i: =1 to 20 do readln (A[i]); { } max:=A[1]; for I:=2 to 20 do if A[i]>max then max:=A[i]; write(.=,max); end.  

8

:

1. ?

2. , ()?

3. , , , ?

4. ?

 

 

:

1. , A(15,15) . , .. .

2. (10,8) .

3. (9,5) , .

4. (7,9) max min .

5. (8,9) . .

6. , - (10,10).

7. (6,6) .

8. D(10,15) . .

9. X(12,4) , . .

10. X(7,11). Y(7,11) , .

11. (10,10) , .

12. X(6,6). , , .

13. X(8,8) , ; ; .

14. (8,12). : .

15. (7,7) (7,7). (7,7) : .

16. (5,10). , i- i- .

17. n. , .

18. 4 25 . , 5.

19. 4 25 . , .

20. n m . .

 

:

:

1. .., .., .. . - .: , 1988. - 320 .

2. .., .. . - .: , 1987. - 112 .

3. . ./. . .: , 1989. - 360 .

4. . . - .: , 1982. - 382 .

5. ., ., . Delphi: . . - : ., 1995. - 608 .

6. , .. Delphi: . .- .: , 1995. - 464 .

7. .. Delphi : - .: . - 316 .

:

1. .. . - .: , 1988. - 224 .

2. .. : . . - .: , 1989. - 160 .

3. . : . . - .: , 1987. - 232 .

4. . Windows: 2 .; . . - .: , 1993. - 536 .

5. .. . 3- . 1. . - .: .-. - , 1992. - 304 .

6. .. Windows. - .: .-. - , 1994. - 539 .

 

:

. , .

:

var Matrix: array[1..4,1..3] of real;

Cube3D: array[1..5,1..5,1..5] of integer;

, . , n m .

. , . . , . , . , .

, n m , , n*m. . - , .

:

Type =array[1..n,1..m] of ;

Var : ;

, , Const. Const.

: X[1..2,1..3] .

 

program max; type mas=array[1..2,1..3]of real; var A: mas; i,j: integer; max: real; begin { } for i:=1 to 2 do for j:=1 to 3 do readln (A[i,j]); { } max:=A[i,j]; for i:=1 to 2 do for j:=1 to 3 do if A[i,j]>max then max:=A[i,j]; write(.=,max); end.  

9

:

1. .

2. ?

3. ?

4. ?

5. ?

6. ?

:

1. , , . .

2. , . .

3. , .

4. , , .

5. (10,10) (5,7).

6. . (25,5). (23,5), (22,5), D(24,5). .

7. , n m. .

8. . , .

9. . , -, .

10. 5- . , ( ), , .

11. m. -.

12. r , . , .

13. (3,4) (4,6). .

14. D , : , .

15. , x, y, z <1.

16. : .

17. , x, y <1.

18. , r (1,1); x(20), Y(20). .

19. present, , .

20. .

:

:

1. .., .., .. . - .: , 1988. - 320 .

2. .., .. . - .: , 1987. - 112 .

3. . ./. . .: , 1989. - 360 .

4. . . - .: , 1982. - 382 .

5. ., ., . Delphi: . . - : ., 1995. - 608 .

6. , .. Delphi: . .- .: , 1995. - 464 .

7. .. Delphi : - .: . - 316 .

:

1. .. . - .: , 1988. - 224 .

2. .. : . . - .: , 1989. - 160 .

3. . : . . - .: , 1987. - 232 .

4. . Windows: 2 .; . . - .: , 1993. - 536 .

5. .. . 3- . 1. . - .: .-. - , 1992. - 304 .

6. .. Windows. - .: .-. - , 1994. - 539 .

:

, . , . . , .

( ), - . , . , , ClearDevice;. , , ( ).

, , :

program...

const...

type...

var...

procedure MyProc(< >);

begin

{}

end;

begin

{ }

end.

 

a+b, b+c a+c:

program Max3;

var a,b,c,m: integer;

procedure FindMax(n1,n2,n3:integer;var max: integer);

begin

if n1>n2 then max:=n1 else max:=n2;

if n3>max then max:=n3;

end;

begin

write('Ââåäèòå a: '); readln(a);

write('Ââåäèòå b: '); readln(b);

write('Ââåäèòå c: '); readln(c);

FindMax(a+b,b+c,a+c,m);

writeln('Ìàêñèìóì èç ñóìì = ',m);

readln;

end.

( ) . , , n1, n2 n3, integer, max ( m). , (n1,n2,n3) -; , -, var. , (n1, n2, n3, max), , , (a+b, b+c, a+c, m) .

. , . , -.

, . , .

. , :

1. ( ) ( , , , );

2. ( Max:=m;).

m, , , , . - .

:

function ( )

{ }

begin

{ }

end;

, . , . , function, .

:

. : , p , a, b, c .

function Square(a,b,c: real): real;

var p: real;

begin

p:=(a+b+c)/2;

Square:=sqrt(p*(p-a)*(p-b)*(p-c));

end;

10

:

1. string ?

2. ?

3. ?

4. , ?

5. ?

6. .

 

:

1. . .

2. , .

3. , ( 0 127). . , 0 15, 16 31 ..

4. , , .

5. , 1 8 . .

6. , .

7. .

8. .

9. , , .

10. .

11. , .

12. . , . , *.

13. 1 2.

14. 255 . .

15. , , .

16. , , , .

17. 15 . ( ).

18. . . , .

19. 255 . .

20. , ( ).

 

:

:

1. .., .., .. . - .: , 1988. - 320 .

2. .., .. . - .: , 1987. - 112 .

3. . ./. . .: , 1989. - 360 .

4. . . - .: , 1982. - 382 .

5. ., ., . Delphi: . . - : ., 1995. - 608 .

6. , .. Delphi: . .- .: , 1995. - 464 .

7. .. Delphi : - .: . - 316 .

:

1. .. . - .: , 1988. - 224 .

2. .. : . . - .: , 1989. - 160 .

3. . : . . - .: , 1987. - 232 .

4. . Windows: 2 .; . . - .: , 1993. - 536 .

5. .. . 3- . 1. . - .: .-. - , 1992. - 304 .

6. .. Windows. - .: .-. - , 1994. - 539 .

 

:

( ) - string. ( , 0 ). :

1. var s: string; ( 255 ),

2. var s: string[n]; ( n , n ).

, .

: , :

program Hello;

var s: string;

begin

write(' : ');

readln(s);

write(', ',s,'!');

readln;

end.

. , , , 1. , , . , , .

n- s[n]. s[0] .

. , . , , . . - , , . , , . : ''<'', ''>'', ''<'A', 'hell'<'hello'.

() . +, , . : s:= 'abc'+'def'+'ghi'; s abcdefghi.

.

:

length(s: string): integer;

, , . s.

:

 

 

Copy(s:string; start: integer;len: integer): string s, start, len s:=; s1:=Copy(s,4,4); { s1 }
Pos(s1:string;s:string):byte s1 s. , , s1 s; s1 s, 0 n:=pos(, ); {=3} n:=pos(abc, stuvwxyz); {=0}
Insert(s1:string; s:string; start: integer) s1 s start. S:=; insert(,s,3); { s }
Delete(s:string;start: integer; len:integer) s , start len s:= ; delete(s,4,7); { s }

: , .

Program pr1;

var ST: string [80]; {}

begin

writeln ( );

write ( );

readln (ST);

while(pos ( , ST)=1) and (length (ST)>0) do

delete (ST, 1, 1);

write( :, ST);

readln;

end.

CONSTRUCTOR. , ( !) .

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





:


: 2017-02-25; !; : 453 |


:

:

. .
==> ...

1473 - | 1433 -


© 2015-2024 lektsii.org - -

: 0.286 .