kk258966

5-7

Nov 3rd, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.  
  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5.         Dim x As Integer
  6.         Dim z As Integer
  7.         Dim y As String
  8.         Dim m As Integer
  9.         Dim a As Integer
  10.         x = Val(TextBox1.Text)
  11.         a = (x - 1000) / 400    
  12.         y = x - 1000    '扣除初始1000M
  13.        z = y Mod 400   '判斷是否剛好滿400M
  14.        If z = 0 Then
  15.             m = 0
  16.         Else
  17.             m = 1
  18.  
  19.         End If
  20.         If x <= 1000 Then
  21.             Label3.Text = 100
  22.         Else
  23.  
  24.             Label3.Text = 100 + (a + m) * 5    
  25.         End If
  26.  
  27.  
  28.     End Sub
  29.  
  30.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  31.         End
Advertisement
Add Comment
Please, Sign In to add comment