vb,3. 求Sn=a+aa+aaa+aaaa+…+aa…aaa(n个a),
发布网友
发布时间:2023-06-26 19:12
我来回答
共4个回答
热心网友
时间:2023-07-04 04:26
Private Sub Form_Click()
Dim a As Integer
Dim n As Integer
Dim s As String
s = ""
Randomize
a = Int(Rnd() * 9) + 1
n = Int(Rnd() * 6) + 4
For i = 1 To n
s = s + String(i, CStr(a))
If i <> n Then s = s + "+"
Next
Print "当a=" & a & "时,n=" & n & "时, S=" & s
End Sub
Private Sub Form_Load()
Me.Width = 9000
Me.FontSize = 12
End Sub
热心网友
时间:2023-07-04 04:26
222222222222222222=(2的n次方-1)/9 *2
用这个公式你就应该会了.不会再说.不想打字.
好好努力
热心网友
时间:2023-07-04 04:27
for n=1 to int(inputbox()) Sn=Sn+n*a*10"n next n
热心网友
时间:2023-07-04 04:27
我回答过一个··你看下面的链接好了···
参考资料:http://zhidao.baidu.com/question/146458200.html