1樓:醉期眸
呵呵,估計只有這裡題目會是「1000萬」,因為這樣就溢位了,並且老師上課是按1000演示的,我這裡也是1000記錄的。
老師筆記(是按1000來的):
private sub command1_click()dim n, pingfang, diwei as doublefor k = 3 to 1000
pingfang = k ^ 2
if k < 10 then
diwei = pingfang mod 10elseif k < 100 then
diwei = pingfang mod 100elseif k < 1000 then
diwei = pingfang mod 1000end if
if diwei = k then
print k;
end if
next k
end sub
剛試驗過,可以保證執行.
我們來體會作業最後一句話哈,呵呵,怎麼「參考」,大家都懂的......
o(╯□╰)o
2樓:匿名使用者
程式不如xuanxuan163com的好,結果一樣private sub command2_click()n1 = 3: n2 = 10000000for s = n1 to n2
t = s ^ 2
s1 = trim(s): s2 = trim(t): k = len(s1)
if right(s2, k) = s1 then print (s1 & "^2=" & s2)
next
end sub
結果:5^2=25
6^2=36
25^2=625
76^2=5776
376^2=141376
625^2=390625
9376^2=87909376
90625^2=8212890625
109376^2=11963109376
3樓:匿名使用者
題目:根據下面窗體中題目要求設計程式,當單擊「確定」按鈕時,將蘋果可能的數量及分法在窗體上顯示出來。 private sub form_click() dim s as
4樓:匿名使用者
private sub command1_click()for i = 3 to 10000000if val(right(i ^ 2, len(i))) = i then print i
next i
end sub
VB程式設計急求,急求VB程式設計程式碼!!!!
private sub command1 click 計算應發工資,text4 text4 val text1 val text2 val text3 計算個人所得稅,text5 if val text4 1000 thentext5 0 elseif val text4 1000 and val ...
急求VB程式設計答案
private a 1 to 1000 as integer,b 1 to 1000 as integer,n as integer private sub mand1 click text1.text randomize for i 1 to 20 a i int rnd 101 100text1...
一道vb程式設計題目急求答案,一道C 程式設計題目 急求答案
private sub form load text1.left 0 text1.top 0 text1.width me.scalewidth 2 text1.height me.scaleheight 2 command1.left me.scalewidth command1.width co...