Advertisement
imjyb1008

1613122602156_02

Dec 26th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Command2_Click()
  2. '2.利用 InputBox 連續輸入數值資料,直到輸入值等於-1時,方才結束輸 入, 最後最後把所有輸入值中最大的數值列出來?
  3.    Cls
  4.    
  5.     Dim max As Integer
  6.    
  7.     n = InputBox("請輸入數值")
  8.     max = n
  9.    
  10.     Do While n <> -1
  11.        
  12.         n = InputBox("請輸入數值")
  13.        
  14.         If n > max Then
  15.             max = n
  16.         End If
  17.        
  18.     Loop
  19.    
  20.     Print max
  21.    
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement