1樓:匿名使用者
一、private sub ***mand1_click()randomize
dim x(1 to 50) as integerfor i = 1 to 50
x(i) = int(rnd() * 101) + 100if x(i) mod 7 = 0 then print x(i)next i
end sub
二、private sub ***mand1_click()zf = "我喜歡"
if ch1.value = 1 then zf = zf & ch1.caption & "、"
if ch2.value = 1 then zf = zf & ch2.caption & "、"
if ch3.value = 1 then zf = zf & ch3.caption & "、"
text1 = mid(zf, 1, len(zf) - 1)end sub
private sub form_load()ch1.caption = "游泳"
ch2.caption = "體操"
ch3.caption = "滑冰"
text1 = ""
end sub
三、private sub ***mand1_click()if val(text1) < 1 thenmsgbox "請輸入數字!"
exit sub
end if
text1 = val(text1)
if option1.value = true thentext2 = jsh
elseif option2.value = true thentext2 = osh
elseif option3.value = true thentext2 = pfh
else
text2 = lfh
end if
end sub
private sub form_load()option1.caption = "偶數和"option2.caption = "奇數和"
option3.caption = "平方和"
option4.caption = "立方和"
end sub
private function jsh()k = val(text1)
for i = 1 to k step 2jsh = jsh + i
next i
end function
private function osh()k = val(text1)
for i = 2 to k step 2osh = osh + i
next i
end function
private function pfh()k = val(text1)
for i = 1 to k
pfh = pfh + i ^ 2
next i
end function
private function lfh()k = val(text1)
for i = 1 to k
lfh = lfh + i ^ 3
next i
end function
2樓:匿名使用者
第一題dim i as integer, data(10) as integer
for i = 0 to 10
data(i) = rnd(now) * 100 + 100next i
for i = 0 to 10
if data(i) mod 7 = 0 thenform1.print data(i)
end if
next i
3樓:匿名使用者
第1題:
dim a(121) as integer
dim x as integer
private sub form_load()
randomize
for x = 0 to 120
a(x) = int(rnd * 101 + 100)
if a(x) mod 7 = 0 then
print a(x)
end if
next x
end sub
第2題:
text1.text = "我喜歡"
if check1.value = 1 then
text1.text = text1.text & check1.caption
end if
if check2.value = 1 then
text1.text = text1.text & check2.caption
end if
if check3.value = 1 then
text1.text = text1.text & check3.caption
end if
第3題:
dim i, j as integer
sub op1(x as integer)
j = 0
for i = 0 to x
if i mod 2 = 0 then
j = j + i
end if
next i
text2.text = text2.text & "偶數和:" & i
end sub
sub op2(x as integer)
j = 0
for i = 0 to x
if i mod 2 <> 0 then
j = j + i
end if
next i
text2.text = text2.text & "奇數和:" & i
end sub
sub op3(x as integer)
j = 0
for i = 0 to x
j = j + i * i
next i
text2.text = text2.text & "平方和:" & i
end sub
sub op4(x as integer)
j = 0
for i = 0 to x
j = j + i * i * i
next i
text2.text = text2.text & "立方和:" & i
end sub
private sub ***mand1_click()
dim y as integer
if text1.text = "" or (not isnumeric(text1.text)) then
msgbox "輸入錯誤,請重新輸入"
else
y = val(text1.text)
if option1.value = true then
op1 (y)
end if
if option2.value = true then
op2 (y)
end if
if option3.value = true then
op3 (y)
end if
if option4.value = true then
op4 (y)
end if
end if
end sub
private sub form_load()
option1.value = true
end sub
行不???
vb題求大神解答
4樓:匿名使用者
打碼有問題,*號應加雙引號,結果如下:
你應該是想要這樣的結果吧?
5樓:匿名使用者
print * 這個是錯的吧,應該是 print 「*」才能執行
6樓:匿名使用者
難道可以執行這個語句?
print *
vb題求大神解答
7樓:聽不清啊
private sub ***mand1_click()dim w(), y()
w = array("", "一", "二", "三", "四", "五bai", "六", "日")
y = array("", "英語", "數學du", "語文", "物理zhi", "計算
dao機", "休息", "休息")
if text1 >= "1" and text1 <= "9" then
x = asc(text1) - 48
text2 = w(x)
text3 = y(x)
else
msgbox ("有效版輸入數權字範圍1-7")end if
end sub
8樓:匿名使用者
private sub ***mand1_click()
if val(text1.text) > 7 or val(text1.text) < 1 then
msgbox "有效數字輸
入範圍1-7"
exit sub
end if
text2.text = choose(val(text1.text), "一", _
"二", "三", "四", "五", "六", "日")
text3.text = choose(val(text1.text), "英語", _
"數學", "語文", "物理版", "計算機權", "體育", "休息")
end sub
9樓:志在必得
select case text1.textcase 1
text2.text = "一"
text3.text = "英語"
case 2
text2.text = "二"
text3.text = "數學bai
du"case 3
text2.text = "三"
text3.text = "語文"
case 4
text2.text = "四"
text3.text = "物理"
case 5
text2.text = "五"
text3.text = "計算機
zhi"
case 6
text2.text = "六"
text3.text = "體育dao"
case 7
text2.text = "日"
text3.text = "休息
回"case else
msgbox "有效數字輸入答範圍1-7"
text2.text = ""
text3.text = ""
end select
一道英語題,求大神解答,下面是一道英語題,求大神學霸解答,真心謝謝
d 不是人bai們所畏懼的大du 自然的僅僅活動。zhi.not the only acts of nature不是自然僅有dao的活動內 not only the acts of natur不僅是自然地容活動,而且 d.not the only acts of nature 考點,only adj...
一道英語題,求大神解答
譯 主人非常生氣,把所有的奴隸都帶到他面前。had sth sb done.使某物 某人被.故選擇c brought.答案應該選c,brought.意思是 叫人把所有的奴隸帶到他面前。一道英語題,求大神解答。d 不是人bai們所畏懼的大du 自然的僅僅活動。zhi.not the only acts...
兩道數學題,求大神權威解答啊,兩道數學題 求大神。
9 b 這是通用證法,用x ny m代表直線ab方程可能簡單點。你可以試試。設m m,0 直線ab方程為y k x m 代入拋物線方程得 k x 2mk 2p x k m 0 設x x 為其兩個解。則ma 1 k x m mb 1 k x m 所以1 ma 1 mb x m x m 1 k x m ...