( )
. Turbo Pascal
5
.
. , , , , . ; ; , , ; , , .
1. . . : / . ., . ., . . : , 2010. 192 .
2. . . 1 2 / . . : , 2006. 134 .
3. .
-
1. , , , .
1. ?
2. ?
3. ?
4. ?
5. Pascal?
, .
ϳ .
, , .
, , , , , .
(array) () , ' .
; .
, ( ).
Pascal TYPE ARRAY, "". '; , , VAR .
. .
:
Var
: array [< > ] of <>;
;
|
|
array Pascal, , ;
, () ;
.
type, const, var. .
. ( ) , , [1] , b[2] b.
, , . Pascal :
type <'__>= array [<_>] of <>,
type , ;
arra... of ("...");
<'__> ' , ( );
<_> . - , longinteger. -, ;
<> - , , real, integer, char .
:
type M= array [1..10] of integer;
type AR= array [0..15] of real;
type VT= array [-5..5] of single;
type GRUP= array [1..27] of string [10];
, , .
:
var REZ:M;
var P:AR;
var A:VT;
var STUD:GRUP;
, , : varREZ: array [1..10] of integer;
' , , REZ[1], POLE[0], A[5], STUD[i].
, 1 .
, V 5 (3, 0, 5, -7, 8), 0 ( V[2]=0), ' 8 ( V[5]=8) ..
.
' (, ) , .
1. .
2. .
3. , , , , .
:
- Pascal :
1. [1..n] , 5. .
2. [1..n]. , , .
3. [1..n] .
4. [1..n] , 4 .
|
|
5. [1..n]. .
6. S[1..n]. , , .
7. [1..n]. , , .
8. [1..n]. .
9. n a[1..n]. , i+1<ai<i!.
10. n, x a[1..n]. , x, , ; -10.
11. n c[1..n]. a b. , 1≤ k ≤n-1 , ck<a, ck+1>b?
12. n x[1..3n]. xn+1,..., x3n, x1,..., xn.
13. n a[1..n]. .
14. n a[1..n]. , ' .
15. n a[1..n]. ', .
ֲ
1. .
2. .
3. .
4. , , , -, ( ), ( ).
5. , .
6. ϳ .
15 =(0.01; -27.3; 0; 1.25; -371; 0.5; -0.1; 1.2; -5; -172.3; 19.1; -2.7; 43.51; 0; -0.02) .
, - .
˳ :
program asuv;
uses crt;
Type
MAS=array[1..15] of real;
Var
x:MAS; i,n:integer;
min:real;
Begin
clrscr;
writeln( );
for i:=1 to 15 do
begin
write('x[',i,']=');
readln(x[i]);
end;
min:=x[1];
n:=1;
for i:=1 to 15 do
begin
if x[i]<min then
begin min:=x[i]; n:=i; end;
end;
writeln(' ', min:5:2,' ', ' :',n);
End.
- :
x[1]=0.01 | |
x[2]=-27.3 | |
x[3]=0 | |
x[4]=1.25 | |
x[5]=-371 | |
x[6]=0.5 | |
x[7]=-0.1 | |
x[8]=1.2 | |
x[9]=-5 | |
x[10]=-172.3 | |
x[11]=19.1 | |
x[12]=-2.7 | |
x[13]=43. | |
x[14]=0 | |
x[15]=-0.02 | |
-371.00 | : 5 |
1. Pascal?
2. ?
3. ?
4. ?
5. ?
____________ . .