1樓:匿名使用者
function ss(tos as integer) as integer ' tos參與復計算
制的最後一個數
dim i as integer
ss = 0
for i = 1 to tos
if i mod 2 = 0 then
ss = ss - i
else
ss = ss + i
end if
next
end function
ss(100) 的值為-50
2樓:匿名使用者
dim i as interger
dim j as interger
dim s as interger
s=0j=-1
for i = 1 to 100
j=j*(-1)
s=s + i*j
next i
debug.print s
1-2+3-4+5-...+99-100的值。vb程式的**是怎樣的?
3樓:匿名使用者
看到都復覺得羞制恥,這麼多人bai亂髮程式來du騙分,丟臉zhi,以下是正確答
dao案
private sub form_click()me.cls
dim i, sum as single
for i = 1 to 100
sum = sum + i * (-1) ^ (i - 1)next i
print sum
end sub
4樓:匿名使用者
vb的:
private function js()dim s, i as integer
for i = 1 to 100 step 1if i mod 2 = 0 then
s = s - i
else
s = s + i
end if
next
js = s
end function
5樓:匿名使用者
main() }
6樓:
dim s%
fh=1
for i =1 to 100 step 1s=s+i
fh = -fh
next i
vb程式設計計算,VB程式設計計算 1 2
private sub command1 click dim i as integer,j as integerdim l as long,h as longfor i 1 to 10 h 1 for j 1 to i h h j next l l h next print l end sub pr...
vb程式設計教程答案,vb程式設計教程答案
option explicit private sub command1 click dim a as integer dim i,j,n redim a 9,9 for i 1 to 8 print tab 25 i 2 for j 1 to i a i,1 1 a i,i 1 a i 1,j 1...
vb中程式設計序求s
最標準,復簡單 dima asinteger,bas long,s asdoubleb 0a 1 s 0fora 1to100b b as s 1 ba a 1next aprint s 制 說明下把 先定義a 是整型,再定義一個b 是長整型,讓s 是雙精度型別,因為1 長整數 得到的必定超過了單精...