Представити математичний запис фрагмента програми і обчислити значення результату за отриманою формулою, якщо елементи лінійного масиву визначаються за рекурсивною схемою
1.
| ReadLn(K); N: =N*K;
For J: =1 To N-1 Do
X[J]: =0.5*(A[J]+A[J+1]);
For J: =1 To N-1 Do
If A[J]*A[J+1]> 0
ThenX[J]: =Sqrt(A[J]*A[J+1]);
| 7.
| Rm: =A[1]; Rb: =A[N];
For J: =2 To N Do
Begin
If A[J]< Rm Then Rm: =A[J];
If A[N-J+1]> Rb Then
Rb: = A[N-J+1];
End; Rm: =Rb/Rm;
|
2.
| T: =N; J: =1;
While J< =N Do
Begin
X: =A[J]; L: =J;
For I: =J+1 To N Do
If A[I]> X Then
Begin
X: =A[I]; L: =I
End;
Y: =A[J]; A[J]: =T*X; A[L]: =Y;
J: =J+1;
End;
| 8.
| M: =N Div 2; K: =N;
For J: =1 To M Do
Begin
Y: =A[J]; A[J]: =A[K];
A[K]: =Y; K: =K-1
End;
X: =A[1];
|
3.
| R: =0; T: =N; F: =1;
For L: =1 To T Do
Begin
F: =F*L;
R: =R+A[L]/F/1.0E-3
End;
R: =2*R/T;
| 9.
| X: =1; K: =0;
For J: =1 To N Do
If A[J]> 0 Then
Begin
X: =X*A[J]; K: =K+1End;
If K< > 0 Then X: =Exp(1/K*Ln(X));
|
4.
| L: =1; X: =A[L];
While L< =N Do
Begin
If A[L]> X Then X: =A[L];
A[L]: =A[L]*X/L; L: =L+1;
End;
| 10.
| P: =1; S: =0;
For J: =1 To N Do
If J Mod 2=1 Then
Begin
S: =S+A[J];
P: =P*S/(A[J]+1)
End;
A[J]: =S;
|
5.
| T: =3; X: =A[N+1];
For J: =1 To N Do
X: =X+A[J]*Exp((N-J-1)*Ln(T));
| 11.
| T: =2; X: =A[1];
For J: =1 To N Do
X: =X*T+A[J+1];
|
6.
| X: =A[N];
For J: =N-1 DownTo 1 Do
X: =A[J]+1/X;
| 12.
| X: =0; K: =0;
For J: =1 To N Do
If A[J]> 0 Then
Begin
X: =X+A[J]; K: =K+1End;
If K< > 0 Then X: =X/K;
|
13.
| ReadLn(K); N: =N*K;
For J: =1 To N-1 Do
X[J]: =0.5*(A[J]+A[J+1]);
For J: =1 To N-1 Do
If A[J]*A[J+1]> 0
ThenX[J]: =Sqrt(A[J]*A[J+1]);
| 19.
| L: =1; X: =A[L];
While L< =N Do
Begin
If A[L]> X Then X: =A[L];
A[L]: =A[L]*X/L; L: =L+1;
End;
|
14.
| R: =0; T: =N; F: =1;
For L: =1 To T Do
Begin
F: =F*L;
R: =R+A[L]/F/1.0E-3
End;
R: =2*R/T;
| 20.
| M: =N Div 2; K: =N;
For J: =1 To M Do
Begin
Y: =A[J]; A[J]: =A[K];
A[K]: =Y; K: =K-1
End;
X: =A[1];
|
15.
| Rm: =A[1]; Rb: =A[N];
For J: =2 To N Do
Begin
If A[J]< Rm Then Rm: =A[J];
If A[N-J+1]> Rb Then
Rb: = A[N-J+1];
End;
Rm: =Rb/Rm;
| 21.
| For Z: =1 To N Do
Begin
M: =A[Z]; K: =Z;
For I: =Z+1 To N Do
If A[I]< M Then
Begin
M: =A[I]; K: =I
End;
Y: =A[Z]; A[Z]: =T*M; A[K]: =Y;
End;
|
16.
| X: =1; K: =0;
For J: =1 To N Do
If A[J]> 0 Then
Begin
X: =X*A[J]; K: =K+1End;
If K< > 0 Then X: =Exp(1/K*Ln(X));
| 22.
| For J: =1 To N-1 Do
If A[J]*A[J+1]< =0
ThenX[J]: =0.5*(A[J+1]+A[J])
ElseX[J]: =Sqrt(A[J]*A[J+1]);
|
17.
| P: =1; S: =0;
For J: =1 To N Do
If J Mod 2=1 Then
Begin
S: =S+A[J];
P: =P*S/(A[J]+1)
End;
A[J]: =S;
| 23.
| X: =0; K: =0;
For J: =1 To N Do
If A[J]< 0 Then
Begin
X: =X+Abs(A[J]);
K: =K+1
End;
If K< > 0 Then X: =-X/K;
|
18.
| X: =0; K: =0;
For J: =1 To N Do
If A[J]> 0 Then
Begin
X: =X+A[J]; K: =K+1End;
If K< > 0 Then X: =X/K;
| 24.
| X: =A[1];
For J: =2 To N Do
If A[J]< X Then X: =A[J];
|