1樓:匿名使用者
option explicit
private sub form_dblclick()dim i as integer
dim s as long
for i = 20 to 263
s = s + i
next i
print "s=";s
end sub
print中「,」為標準格式一行輸出五個,「;」為緊湊格式
2樓:
糾結,前面兩個回答都不對吧?
dim i as integer
dim s as long
for i=20 to 263
s=s+i
next i
3樓:匿名使用者
private sub form_dblclick()dim s
dim i as long
sum = 0
for i = 20 to 263
s = s + i
next i
print s
end sub
'結果已儲存到變數s中,print s
是把這個變數輸出在窗體
4樓:徐玉基
dim s as integer =0
for i as integer= 20 to 263s= s+i
next
vb程式設計題:(事件)雙擊窗體。(響應)求x=1+1*2+1*2*3+...+1*2*3*...*10,並將結果存到變數s中
5樓:匿名使用者
樓上兩位(kumu0531和892113807)是胡扯。。。還interger呢!(integer)。
private sub form1_dbclick()dim a, s as long'計算數值很大,要用長整型for i = 1 to 10
a = 1
for j = 1 to i
a = a * j
next
s = s + a
next
print s
end sub
6樓:匿名使用者
dim x(0 to 10 ),x,s,as intergerprivate sub form_dbclick()x(0)=1
for i=1 to 10
for j=1 to i
x(j)=x(j-1)*i
next j
x=x+x(j)
next i
s=x試試看吧
急!!vb程式設計問題,求和,輸出到窗體,結果存入變數 10
7樓:匿名使用者
private sub command1_click()dim s as integer, i as integer, xx as string
s = 0
for i = 3 to 300 step 3s = s + i
xx = xx & i & " + "
if i mod 30 = 0 then xx = xx & vbcrlf
next i
xx = left(xx, len(xx) - 5)print xx & vbcrlf & " = " & send sub
8樓:
private sub command1_click()dim i, sum as integerfor i = 1 to 300
if i mod 3 = 0 then
sum = sum + i
end if
next i
print sum
end sub
9樓:
private sub form_dblclick()dim i, b, sum
for i = 3 to 300 step 3sum = sum + i
if i = 3 then
b = b & 3
else
b = b & "+" & i
end if
next
print b & " =" & sum
end sub
窗體最多顯示那麼多了
10樓:匿名使用者
100個數值的和,窗體上這個式子顯示得太難看了吧?
急急急C語言程式設計,急急急 !!!簡單C語言程式設計題,
include stdio.h include string.h main puts a 以puts 形式輸出字串 程式說明 利用冒泡原理編寫,第2個字元跟後面的字元 不包含最後一個字元 進行比較,把大的字元放在這個位置,然後第3個字元跟後面的字元 不包含最後一個字元 比較,把大的放到此位置,依次類...
急急急!編寫大一VB程式設計 輸出如下圖形(共四行,第一行,第二行,第三行,第四行
private sub mand1 click dim i for i 1 to 4 print tab 7 i string i 2 1,next end sub for i 1 to 4 for j 1 to 2 i 1 print next j print next i for i 1 to ...
C程式設計題(急急急)
include include using namespace std class point point類宣告point point p int getx int gety private int x,y point point point p 拷貝建構函式的實現 類的組合 class line ...