1樓:聽不清啊
private sub ***mand1_click()randomize
dim a as long, b as long, n as integer
a = rnd * 1000 + 1
do while true
b = rev(a)
if b = a or n = 7 then exit doprint a; "+"; b; "="; a + ba = a + b
n = n + 1
loop
end sub
function rev(byval x)while x > 0
y = y * 10 + x mod 10x = x \ 10
wend
rev = y
end function
求vb大佬看看這哥問題如何解決 謝謝!!
2樓:匿名使用者
public function jiecheng(byval n as integer) as integer
dim jc as integer = 1
for i = 1 to n
jc = jc * i
next
return jc
end function
public function jiecheng(byval n as integer) as double
dim jc as double
jc = 1
for i = 1 to n
jc = jc * i
next
jiecheng = jc
end function
private function factorial1(intn as integer) as integer
'採用遞迴計算階乘
if intn = 0 then
factorial1 = 1
else
factorial1 = factorial1(intn - 1) * intn
end if
end function
給你幾個階乘的函式,你可以直接呼叫階乘的函式去做哦
3樓:匿名使用者
option explicit
private sub ***mand1_click()
dim m as double, n as double
inputdata m, "m"
inputdata n, "n"
if m < n then
print "***bination(" & m & "," & n; ")=" & 0
else
print "***bination(" & m & "," & n; ")=" & factorial(m) / (factorial(n) * factorial(m - n))
end if
end sub
public sub inputdata(byref t, byval char as string)
t = inputbox(char + "=", "輸入框", 25)
if int(val(t)) <> val(t) or val(t) < 0 then
msgbox "資料錯誤!
請重新輸入:", 16
inputdata t, char
end if
end sub
public function factorial(byval r)
dim i as integer
factorial = 1
for i = 1 to r
factorial = factorial * i
next i
end function
求vb大佬看看!!謝謝!!**怎麼寫!!
4樓:匿名使用者
本程式使用了控制項陣列:
**:private type student
stu_id as string
name as string
*** as string
politicalorientation(1) as string
end type
private sub ***mand1_click()
dim stud as student
with stud
.stu_id = text1.text
.name = text2.text
for i = 0 to 1
if option1(i).value then .*** = option1(i).caption
if check1(i).value then
.politicalorientation(i) = check1(i).caption
else
.politicalorientation(i) = "非" + check1(i).caption
end if
next i
picture1.print "學號:" + .stu_id
picture1.print "姓名:" + .name
picture1.print "性別:" + .***
picture1.print "政治面貌1:" + .politicalorientation(0)
picture1.print "政治面貌2:" + .politicalorientation(1)
picture1.print
write #1, .stu_id; .name; .***, .politicalorientation(0); .politicalorientation(1)
close #1
end with
end sub
執行效果:
5樓:
可以實現的哈,戳頭像取數字要答案
6樓:匿名使用者
追加寫檔案
dim s as string
dim filename as stringfilename = shuxiang & xingzuo & ".txt"
open filename for input as #1do while not eof(1)
line input #1, s
print s
loop
close #1
求大佬解決乙個vb問題
7樓:聽不清啊
private sub ***mand1_click()
dim m as integer, n as integer
m = inputbox("請輸入矩陣的行數:")
n = inputbox("請輸入矩陣的列數:")
dim a(20, 20) as integer
m1 = 1: n1 = 1: m2 = 1: n2 = 1
randomize
for i = 1 to m
for j = 1 to n
a(i, j) = rnd * 90 + 10
print a(i, j);
if a(i, j) > a(m1, n1) then m1 = i: n1 = j
if a(i, j) < a(m2, n2) then m2 = i: n2 = j
next j
next i
print "最大值: a(" & m1 & "," & n1 & ")=" & a(m1, n1)
print "最小值: a(" & m2 & "," & n2 & ")=" & a(m2, n2)
end sub
程式設計問題,求大佬幫忙
8樓:aaa軟體教育
如果有心從事程式設計方向的工作,最好到專業機構深入學習、多實踐,更貼近市場,這樣更有利於將來的發展。建議考慮時下火爆的python,python不僅入門簡單,靈活高效。更是在人工智慧方面應用廣泛,對將來大有裨益
求大佬解釋以下vb**,每一步的詳細解釋!!!
9樓:陽光的雷咩咩
感覺應該還有很多**沒貼出來
不管是什麼語言,思路都應該差不多的,就是用列表代表蛇的每個節點,定時增加頭和去掉尾
程式設計題,求大佬幫忙解答一下 謝謝辣
include int main c語言程式設計題求大佬幫忙解決一下 謝謝了 利用c庫函式提供的方法 很簡單 include define maxn 10 void f long int x,char p int main 你的 將被嵌在這裡 void f long x,char s for i t...
求大佬翻譯一下謝謝,求大佬翻譯一下圖中的英文謝謝
為了進行遊戲,需要乙個利權。如果操作不正常動作的話,請允許您修改在連線韓機 設定 小程式 應用程式 的許可權管理 的許可權管理 要進行詞遊戲 必須得到此許可權 求大佬翻譯一下圖中的英文 謝謝 在圖中 what i see is fingers much better than writings.或者...
求個mcgs大佬看一下這個問題,謝謝大佬
在這裡回覆太麻煩了,如果你還需要,給我個回信,我們 我教你 怎樣將mcgs裡面裝置測試時有的資料進行標籤顯示,求各位mcgs高手幫助啊,謝謝 進入標籤框,然後點選右下角的選擇 顯示 核取方塊,進入顯示屬性選項卡,然後點選 將你要顯示的變數關聯上,就可以用標籤顯示變數了 標籤是不可以的,只能用輸入框,...