跪求用VB编程计算1~100的奇数.偶数.整数和??
急.急.急.急...!!大哥大姐们!!!用VB编程计算1~100的奇数和的程序??用VB编程计算1~100的偶数和的程序??用VB编程计算1~100的整数和的程序??都不...
急.急.急.急...!!大哥大姐们!!!
用VB编程计算1~100的奇数和 的程序??
用VB编程计算1~100的偶数和 的程序??
用VB编程计算1~100的整数和 的程序??
都不完整阿``
类似下边的!
Dim i as Integer,s As Integer
s=0
For i=1 To 100 step 2
s=s+i
next i 展开
用VB编程计算1~100的奇数和 的程序??
用VB编程计算1~100的偶数和 的程序??
用VB编程计算1~100的整数和 的程序??
都不完整阿``
类似下边的!
Dim i as Integer,s As Integer
s=0
For i=1 To 100 step 2
s=s+i
next i 展开
展开全部
Dim sumJ As Integer, sumO As Integer, sumZ As Integer, i As Integer
Private Sub Form_Load()
For i = 1 To 100
sumZ = sumZ + i
If i Mod 2 = 0 Then
sumO = sumO + i
Else
sumJ = sumJ + i
End If
Next
Text1.Text = sumZ & vbCrLf & sumJ & vbCrLf & sumO
End Sub
Private Sub Form_Load()
For i = 1 To 100
sumZ = sumZ + i
If i Mod 2 = 0 Then
sumO = sumO + i
Else
sumJ = sumJ + i
End If
Next
Text1.Text = sumZ & vbCrLf & sumJ & vbCrLf & sumO
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
TableDI
2024-07-18 广告
2024-07-18 广告
仅需3步!不写公式自动完成Excel vlookup表格匹配!Excel在线免,vlookup工具,点击16步自动完成表格匹配,无需手写公式,免费使用!...
点击进入详情页
本回答由TableDI提供
展开全部
dim s as integer
s = 0
for i = 1 to 100 '整数
s=s+i
next i
for i = 1 to 100 '偶数
i = i+1
s=s+i
next i
for i = 1 to 100 '奇数
s=s+i
i = i+1
next i
s = 0
for i = 1 to 100 '整数
s=s+i
next i
for i = 1 to 100 '偶数
i = i+1
s=s+i
next i
for i = 1 to 100 '奇数
s=s+i
i = i+1
next i
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
奇数和
dim i as integer,sumi as integer
for i=1 to 100 step 2
sumi=0
sumi=sumi+i
next i
print sum
偶数和
dim j as integer,sumj as integer
for j=2 to 100 step 2
sumj=sumj+j
next j
print sumj
1-100整数和
dim k as integer, sumk as integer
for k=1 to 100
sumk=sumk+k
next k
print sumk
dim i as integer,sumi as integer
for i=1 to 100 step 2
sumi=0
sumi=sumi+i
next i
print sum
偶数和
dim j as integer,sumj as integer
for j=2 to 100 step 2
sumj=sumj+j
next j
print sumj
1-100整数和
dim k as integer, sumk as integer
for k=1 to 100
sumk=sumk+k
next k
print sumk
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询