:
( )
-2015
1
: , , .
1
1
Y=F1+F2, , . x . . A, B .
Option Explicit
Sub Zadanie_1() -
Const Alfa = 0.5, Betta = 0.2
Dim x as integer, A as double, B as double
Dim F1 as double, F2 as double, Y as double
A = 3.4
B = 12.6
x = Val(InputBox( x)) x
F1 = Abs(Alfa+x^2)^B
F2 = Exp(Alfa+x)*Cos(Betta-A)
Y = F1 + F2
MsgBox(F1= & F1 & F2= & F2)
Msgbox(Y= & Y)
End Sub
2
x 2 6 0,5. F1 F2 1.
Sub Zadanie_2()
Const Alfa = 0.5, Betta = 0.2
Dim x as double, A as double, B as double
Dim Y as double, I as Integer
A = 3.4
B = 12.6
Cells(1,1) = X A1 X
Cells(1,2) = Y B1 Y
I=2
For x=-2 To 6 Step 0.5 x
If (x>=0) And (x<=2) Then Y = Abs(Alfa+x^2)^B
If x>2 Then Y = Exp(Alfa+x)*Cos(Betta-A)
Cells(I,1) = x x AI
Cells(I,2) = Y Y BI
I = I + 1 -
Next x
End Sub
3
.
Sub Zadanie_3()
Const N=10
Dim A(N) as Integer, I as Integer, S as double, K as Integer
Dim Sr as double, Max as Integer, Imax as Integer
WorkSheets(2).Select 2
|
|
Cells(1,1) =
Randomize
For I = 1 To N
A(I) = Int(Rnd*20 10) - . 10 10
Cells(2,I) = A(I)
Next I
S = 0: K = 0: Max = -32000
For I = 1 To 10
If A(I) <> 0 Then , 0
S = S + A(I)
K = K + 1
End If
If (A(I) >=Max) And (A(I) Mod 2 = 0) Then
Max = A(I)
Imax = I
End If
Next I
If K <> 0 Then Sr = S/K Else Sr=0 .
Cells(4,1) = S =
Cells(4,2) = S
Cells(5,1) = K =
Cells(5,2) = K
Cells(6,1) = Sr =
Cells(6,2) = Sr
Cells(7,1) = Max =
Cells(7,2) = Max
Cells(8,1) = Imax =
Cells(8,2) = Imax
End Sub