3
:
, case.
, .
( 5) ( ). . .
.
.
, .
.
VB.NET If :
If X < 0 Then Console.WriteLine("Number must be positive!")
If-Then And, Or Not. , .
If Then
' VB.NET (0 )
End If
Else:
If Then
' VB.NET (0 )
Else
' VB.NET (0 )
End If
:
If result > 48 Then Console.WriteLine(result is >48)
Else Console.WriteLine(result is <48)
End If
Else Elseif:
If Then
'
Elseif Then
'
Elself Then
'
Else
'
End If
If-Then Exit Do Exit For. Exit Do Exit For, VB.NET , Loop Next ( ).
If-Then. , . , Risk :
If income < 100000 Then
Dim risk As String = "too much risk"
Else
Dim risk As String = "love to make a deal"
End If
Console.WriteLine("Your risk level is " & Risk)
:
The name 'risk' is not declared.
risk , ! : , .
, , . (short curcuiting). , foo , bar:
|
|
If foo And bar Then...
VB.NET - 1, VB . Microsoft And Or AndAlso OrElse, :
If foo AndAlso Then...
Select Case
Elself VB.NET Select Case, . :
Dim a As Integer
Select Case a
Case 90
Console.WriteLine("A")
Case 80
Console. WriteLine("B")
Case 70
Console.WriteLine("C")
Case Else
Console.WriteLine("You fail")
End Select
, :
Select Case yourChoice
Case 1 To 9
'
Case -1. 0
'
End Select
1. X, Y, Z . 1, X, Y, Z, - .
2. X=LN(X+2.5) :
X(+1)=LN(X()+2.5), k=0,1,...
, () (+1) , 10^(-4). , [,].
3. ()
å = (1+^2/4^2 ), ( - )
=1
, 10^(-5).
4.
1, <1
Q = 2, 1<=<2
3, 2<=<3
4, 3<=
1
1= - ====
\/+1
2=-1/(+b^2) b1=COS x
a3=-b3*b2 b2=SIN x+COSx
a4=b1+b3 b3=IxI
x .
5. , =10^(-4).
:
(-1)^n*^n /N!
6. , . , 0, 3,2 1 , , - .
7. 50 . .
8. N>0, N . , .
9. , 0 ( ). .
10. f(x)=0,
|
|
2ax+|a-1| >0
e^x
f(x)= =========
(1+a^2)-1 .
11. ,, (=0). ax^2+bx+c=0. , .
12. y (y>0) - (, , , 20- 1901, 1900 ).
13.
(max(x,y,z))^2-2^x*min(x,y,z)
u=
max (x,y,z)/min(x,y,z)
x,y,z- .
14. , SIN COS [0,PI/2], y=sin x .
15. ,, , >=>=. ,, .
16. 1, 1, 1, 2, 2, 2. , 1+1y=c1 2+2y=2, , , .
17. 30 . , , . .
18. (x,y). , , .
19. , N 3. 3, , - .
20.
()
2^(2n+1)
S= å
2n+1
n=1
=0.001 .
21. . , ax^2+bx+c , a=trunc(c mod2+ 5\/ 0c), b=trunc(a div 5 0c+c^2).
22. a, b, c (a^2<>0). , ax^2+bx+c . , .
23. a,b,c m. a<b<c>m, .
24. x y. x y , . , 0.5.
25. x y. [0.5;2.5], 10 . x y .
26. x, y z. , (1;3).
27. a b. , - .
28. a, b c. , .
29. a, b c. , a>b> a<b<c. .
30. a, b c. , a>b>c, , .