|
zadach157.BAS |
|
{* Задача157 *}REM basic ' Найти минимальное из средних арифметических 3 массивов.DEFINT A-Z
CLS
Dim A(27), B(27), C(27)
RANDOMIZE TIMER
For i = 0 To 27
A(i) = RND * 51
B(i) = RND * 51
C(i) = RND * 51
PRINT A(i);
Next: ?
For i = 0 To 27
PRINT B(i);
Next: ?
For i = 0 To 27
PRINT C(i);
Next: ?
For i = 0 To 27
S1 = S1 + A(i)
S2 = S2 + B(i)
S3 = S3 + C(i)
Next
S1 = S1 / 28
S2 = S2 / 28
S3 = S3 / 28
PRINT "Srednie arifm massivov : "; S1; S2; S3
If S1 > S2 Then SWAP S1, S2
If S2 > S3 Then SWAP S2, S3
If S1 > S2 Then SWAP S1, S2
PRINT "Minimalnoe sr. arifmetich : "; S1
End
|