Private Sub Command1_Click()
Dim x As Integer
x = Text1
While x > 0
s = s + x Mod 10
x = x \ 10
If x = 0 And s > 9 Then
x = s
s = 0
End If
Wend
Text2 = s
End Sub
Private Sub Form_Load()
Text1 = ""
Text2 = ""
Command1.Caption = "求数根"
End Sub
你好,vb程序做好了吗?