用vb编写一个程序计算多项式1^1+2^2+......+10^10的值
展开全部
打印效果:1^1+2^2+......+10^10=10405071317
Private Sub Command1_Click()
Dim s As String, i As Integer, a As String, b As Double
s = 1 & "^" & 1
b = 1
For i = 2 To 10
a = i & "^" & i
s = s & "+" & a
b = b + i ^ i
Next i
Print s & "=" & b
End Sub
Private Sub Command1_Click()
Dim s As String, i As Integer, a As String, b As Double
s = 1 & "^" & 1
b = 1
For i = 2 To 10
a = i & "^" & i
s = s & "+" & a
b = b + i ^ i
Next i
Print s & "=" & b
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
dim N as long '多少项
for i=1 to n
for y=1 to n
z=i*I
next
sum=sum+z
next
debug.print sum 'sum即为最终结果,但如果n太大,会出错的
for i=1 to n
for y=1 to n
z=i*I
next
sum=sum+z
next
debug.print sum 'sum即为最终结果,但如果n太大,会出错的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
写这样的程序,最主要是要知道用什么函数表示变量的几次方,这个函数在头文件输出:584115552 ,DZgUdE
追问
我是初学者,能不能再详细点,最好把这道题的编程过程告知一下,谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim s As Double
For i = 1 To 10
s = s + i ^ i
Next
Print s
End Sub
Dim s As Double
For i = 1 To 10
s = s + i ^ i
Next
Print s
End Sub
追问
谢谢,你的过程很清楚,我是这么编的
Private Sub Command1_Click()
Dim i As Double,s as Double
For i = 1 To 10
i=i^i
s = s + i
Next
Print s
End Sub
能帮我指明一下哪儿不对吗?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询