CodePudding user response:
Their top ZIJIDCodePudding user response:
Keyboard input or input file?CodePudding user response:
You won't learn civil is not a reason, when I read the university also learn civil, but why do many people in my class, the key is you this question, after watching the know is a very basic programming problem, in the title of the national computer level 2 test, also be normal difficult topic,Then again, since upstairs is willing to help you advice, it still shows details as soon as possible,
CodePudding user response:
Writing code, it is the PRIvate and so onCodePudding user response:
Private Sub Text1_Change ()
Dim (s) As String, t () As Single, I As Long, avg As Single, n As Long
S=Split (Trim (Text1))
If UBound (s) & lt; 1 Then the Exit Sub
If Right (Text1. Text, 1)="-" Then Exit Sub
ReDim t (UBound (s))
For I=0 To UBound (s)
If Not IsNumeric (s (I)) Then MsgBox "Illegal!" : the Exit Sub
If Val (s (I)) & lt; 1 Then MsgBox "Illegal!" : the Exit Sub
If Val (s (I)) & gt; 100 Then MsgBox "Illegal!" : the Exit Sub
T (I)=Val (s (I))
Avg=avg + t (I)
Next
If s (UBound (s))="1" Then
Avg=(avg + 1)/UBound (t)
For I=0 To UBound (t) - 1
If t (I) & gt;=avg Then n=n + 1
Next
MsgBox "have" & amp; N & amp; "A fraction is greater than or equal to the average, there are" & amp; UBound (t) - n & amp; "A fraction less than average"
End the If
End Sub
CodePudding user response: