●對與錯:
●用電腦運算對與錯:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Boolean, b As Boolean
a = True
b = False
TextBox1.Text = "地球比月球大 is " & a
TextBox2.Text = "地球比木星大 is " & b
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim moon, earth, jupiter As Integer
Dim a, b As Boolean
moon = 1738 : earth = 6378 : jupiter = 71492
a = earth > moon
b = earth > jupiter
TextBox3.Text = "地球比月球大 is " & a
TextBox4.Text = "地球比木星大 is " & b
End Sub
End Class
沒有留言:
張貼留言