8
用VB编程算的
Private Sub Command1_Click()
Dim a%,n%,k%,b%,i%
a = InputBox("a")
n = InputBox("n")
For i = 1 To n
If a Mod 2 0 Then
a = 3 * a + 5
Else:For k = 1 To Sqr(a)
b = a / (2 ^ k)
If b Mod 2 0 Then
a = b:Exit For
End If
Next k
End If
Next i
Print a
End Sub
我用26代进去算对的外...
那等你们老师报答案后告诉我一下..