請各位大俠幫忙解決些VB題

時間 2021-10-23 02:53:35

1樓:

1、題目不是很清楚,能否重述

2、1)if法

private sub form_click()dim fs as single

dim cj as string

fs = inputbox("請輸入分數", "分數轉化")if fs < 100 then

if fs >= 90 then

cj = "a等"

elseif fs >= 80 then

cj = "b等"

elseif fs >= 70 then

cj = "c等"

elseif fs >= 60 then

cj = "e等"

else

cj = "d等"

end if

end if

print cj

end sub

2)select case 法:

private sub form_click()dim fs as single

dim cj as string

fs = inputbox("請輸入分數", "分數轉化")select case fs

case 90 to 100

cj = "a等"

case 80 to 89

cj = "b等"

case 70 to 79

cj = "c等"

case 60 to 69

cj = "e等"

case 0 to 59

cj = "d等"

end select

print cj

end sub

3、private sub form_click()dim i as integer, m as integerdim n as integer

n = 100

dom = sqr(n)

for i = 2 to m

if n mod i = 0 then

goto l

end if

next i

print n

l: n = n + 1

loop while n <= 300

end sub

4、private sub form_click()dim a as integer, b as integerdim n as integer

for a = 1 to 9

for b = 0 to 9

n = a * 1000 + 200 + b * 10 + 3if n mod 23 = 0 then

print n

end if

next

next

end sub

5、private sub form_click()dim m as integer, n as integer, d as integer

m = 10 * 30

print "陌生人給了富翁"; m; "萬元"

s = 1

d = 1

sum = 0

dosum = sum + s

s = s * 2

d = d + 1

loop while d <= 30

sum = sum / 10000000

print "富翁給了陌生人"; sum; "萬元"

end sub

6、private sub form_click()dim m as integer, n as integer, a as integer, b as integer

dim k as integer, l as integerfor k = 11 to 99

if k mod 10 <> 0 thenl = (k mod 10) * 10 + int(k / 10)for a = 1 to 9

for b = 1 to 9

m = a * 10 + b

n = b * 10 + a

if k + m = l + n thenprint k, m

end if

next

next

end if

next

end sub

2樓:匿名使用者

1、private sub form_click()

form1.currentx = form1.width / 2

form1.currenty = form1.height / 2

form1.fontname = "黑體"

form1.fontsize = "12"

form1.forecolor = vbred

form1.print "要顯示的文字"

end sub

2、if方法:

private sub form_click()

dim scor as integer

scor = inputbox("輸入成績:")

if scor > 100 or scor < 0 then

msgbox "成績無效!"

exit sub

end if

if scor >= 90 then

msgbox "該生成績為a等"

elseif scor >= 80 then

msgbox "該生成績為b等"

elseif scor >= 70 then

msgbox "該生成績為c等"

elseif scor >= 60 then

msgbox "該生成績為d等"

else

msgbox "該生成績為e等"

end if

end sub

select方法:

private sub form_click()

dim scor as integer

scor = inputbox("輸入成績:")

if scor > 100 or scor < 0 then

msgbox "成績無效!"

exit sub

end if

select case scor

case is >= 90

msgbox "該生成績為a等"

case is >= 80

msgbox "該生成績為b等"

case is >= 70

msgbox "該生成績為c等"

case is >= 60

msgbox "該生成績為d等"

case else

msgbox "該生成績為e等"

end select

end sub

3、private sub form_click()

dim a, i

for a = 100 to 300

for i = 2 to int(sqr(a))

if a mod i = 0 then exit for

if i = int(sqr(a)) and a mod i <> 0 then print a

next

next

end sub

4、private sub form_click()

dim a, b, num

for a = 1 to 9

for b = 0 to 9

num = a & "2" & b & "3"

if val(num) mod 23 = 0 then print val(num)

next

next

end sub

5、private sub form_click()

dim a, b, i

a = 10 * 30

b = 1

for i = 2 to 30

b = 2 * b

next

print "這乙個月中陌生人給了百萬富翁" & a & "萬元;" & vbcrlf & "百萬富翁給陌生人" & b / 1000000 & "萬元。"

end sub

6、'由於要顯示 的東西太多這裡使用text1文字框顯示,記得要把multiline屬性設為true,scrollbars屬性設為2或3。

private sub form_load()

text1.text = ""

dim num1, num2, num3, num4, a, b, c, d

for a = 1 to 9

for b = 1 to 9

for c = 1 to 9

for d = 1 to 9

num1 = val(a & b)

num2 = val(c & d)

num3 = val(b & a)

num4 = val(d & c)

if num1 + num2 = num3 + num4 and num1 <> num2 then text1.text = text1.text & num1 & "+" & _ num2 & "=" & num4 & "+" & num3 & vbcrlf

next

next

next

next

end sub

請各位大俠幫幫忙,翻譯下急用,請各位大俠幫幫忙,翻譯下。。。急用 5

傳統的東西語構製造,整個故事梗概為幾話說的要素的報道,它們的順序連結立的事被說明了。物語掌握全域性的雖然很方便,但是往往這些要素是具體的語言語表現和直結論無法逃脫的。但是談話言語學在時制變動和話題的提示和構製造,另外 是 為代表的話題,迪士尼標記等課程表現性和如何關注關係呢?各自的要素和相關被使用或...

請各位大俠幫幫忙,幫我兒子起名,請各位大俠幫幫忙,幫我兒子起四字名!!!

蘇杉宜 友誼,與你女兒的友相互映襯 楠 蘇杉友鈺 鈺 y 寶物,珍寶。堅硬的金屬。 藍顏禍淼 蘇杉俊傑 蘇杉宇浩 蘇杉健熙 蘇杉舜哲 蘇杉亞璇 蘇杉夜軒 書上有路 學海無涯,哈哈 你叫這個怎麼樣 蘇杉版那 蘇杉文楠 蘇杉思琴 蘇杉依瑤 蘇杉靜雯 蘇杉思瑋 蘇杉馨卉 瞬之恆 蘇杉友琿 蘇杉友珉 蘇杉友...

各位大俠幫忙猜個字謎,請各位大俠幫忙猜乙個字謎!

愛拉 兪 我想能和你在一起 應該對的,你進這個看看 請各位大俠幫忙猜乙個字謎! 尋覓中的空心菜 楊 海納百川,有容乃大 有容乃大 即指 海 而 洋 自然比 海 更大,所以謎底是 楊 洋 另,隋朝即為楊姓。幫助我猜你個字謎吧,各位大俠 林逸煙 1.筆2.纓 3.一 日 田 目 旦 舊 4.非5.做 6...