值
Dim line() = Split(TextBox1.Text, vbNewLine)
Dim n As Integer = Val(line(0))
For i = 1 To n
Label1.Text &= vbCrLf
Dim k = Val(line(i * 2 - 1))
Dim line1 = line(i * 2)
Dim m = line1.Length
Dim j As Integer
Dim p = 1, sum = 0
For j = m To 1 Step -1
Dim c = Mid(line1, j, 1)
If c <> "0" Then sum += (Val(c) * p)
p *= k
Next
Label1.Text &= sum
Next i
---------第4題 資料---
5
2 1010101 Ans: 85
3 121201 Ans: 451
4 230230 Ans: 2860
5 43201 Ans: 2926
8 760530 Ans: 254296
0 意見:
張貼留言