Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Integer
n = TextBox1.Text
Label1.Text = 2 ^ TextBox1.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim m As Integer
m = TextBox2.Text
Dim ans As Integer
Do Until m = 1
ans += 1
m /= 2
Loop
Label2.Text = ans
End Sub
End Class
沒有留言:
張貼留言