: ,
:
Private Sub Form_Load()
Dim st As String, s2 As String
MsgBox " !!!"
st = InputBox(" ")
MsgBox " " & Chr(13) & st, vbInformation, " "
i1 = 0
k = 0
For i = 1 To Len(st)
If Mid(st, i, 1) = " " Then
P = P + 1
z1 = z1 & "" & P & "- " & i & Chr(13)
s1 = Mid(st, i1 + 1, i - (i1 + 1))
MsgBox P & "- : " & s1
If Left(s1, 1) = Right(s1, 1) Then k = k + 1
i1 = i
End If
Next
MsgBox z1 & Chr(13) & "- " & k
End Sub
:
7
: .
:
Dim fayl As String
Dim xp As Integer
Private Sub Command1_Click()
Dim n As Integer, X As Integer
fayl = Text1.Text
If Option2.Value = True Then
'fayl = " C:\Documents and Settings\student\ \, , 1-3\\1.txt "
fayl = InputBox(" ")
Open fayl For Output As #1
n = InputBox(" ")
For i = 1 To n
X = InputBox(" ")
Print #1, X
Next
Close #1
st = " :" & Chr(13)
End If
Open fayl For Input As #1
Do While Not EOF(1)
Input #1, X
st = st & " " & X
Debug.Print X;
Text2.Text = Text2.Text & X & " "
Loop
Close #1
Debug.Print
Close
End Sub
Private Sub Label11_Click()
Open fayl For Input As #1
Do While Not EOF(1)
Input #1, X
p = Left(X, 2)
t = Right(X, 2)
Loop
Label11.Caption = p
S = p + t
Do While Not EOF(1)
Input #1, X
If X < S Then Sum = Sum + X
Loop
Close #1
End Sub
Private Sub mnu2_Click()
Text1.Text = ""
End Sub
Private Sub mnu4_Click()
Open fayl For Input As #1
Do While Not EOF(1)
Input #1, X
If X > 0 Then xp = X: Exit Do
Loop
Close
Label6.Caption = xp
End Sub
Private Sub mnu5_Click()
nf = FreeFile()
Open fayl For Input As #nf
Do While Not EOF(1)
Input #nf, X
If X < xp Then k = k + 1
If X < Min Then Min = X
Loop
Debug.Print xp: Debug.Print k: Debug.Print Min
st = st & Chr(13) & "" & Chr(13) & "1- =" & xp & Chr(13) & "- " & k & Chr(13) & "" & Min
|
|
MsgBox st
Label7.Caption = k
Label8.Caption = Min
End Sub
Private Sub mnu6_Click()
Open fayl For Input As #1
Dim p As Single, t As Single
Input #1, X
p = Left(X, 1)
Open fayl For Input As #2
Do While Not EOF(2)
Input #2, X1
t = Right(X1, 1)
Loop
S = p + t
Open fayl For Input As #3
Do While Not EOF(3)
Input #3, X
If X < S Then Sum = Sum + X
Loop
Close
Label11.Caption = S
End Sub
:
8