vb利用子程式實現輸入歲數判斷屬相

2022-11-17 20:55:14 字數 669 閱讀 4410

1樓:匿名使用者

function shengxiao(birth as integer) as string

dim i as integer, p as integerconst shx as string = "鼠牛虎兔龍蛇馬羊猴雞狗豬"

p = 3

if birth < 2010 then

for i = 2009 to birth step -1p = p - 1

if p = 0 then p = 12

next i

elseif birth > 2010 thenfor i = 2011 to birthp = p + 1

if p = 13 then p = 1

next i

end if

shengxiao = mid(shx, p, 1)end function

2樓:匿名使用者

dim n as integer

for n=0 to 100

if text1. text=1900+12*nzhen text2.text="鼠"

if 後面挨著次板的寫剩下的十一次

end if

next i

end我也是初學者,不知道對不對,用手機回答的也沒法實驗,坐等高手

vb的sub子程式怎麼用,關於vb的sub子過程的定義問題!

建立sub過程 1 定義sub過程 語句結構如下 static private public sub 過程名 引數列表 語句塊 exit sub 語句塊 endsub 引數列表指明瞭呼叫時傳送給過程的引數的型別和個數,每個引數的格式為 byval 變數名 as 資料型別 如果加上byval則表明該引...

如何編寫vb程式使程式實現以下功能

filelistbox timer控制元件 2個控制元件即可滿足你要求 啟動用shell 批處理可以用exit命令自行退出 vb 編寫一個程式,使其具有如下功能,1 隨機產生10個資料 我可以給你寫 幫你除錯好 vb程式設計題 1.編寫程式實現如下功能 如圖一 2.編寫程式實現如下功能 option...

用VB編個輸入密碼程式(簡單點的)

textbox,command各一個。以下為 const pwd 123456 改成密碼private sub command1 click if text1.text pwd thenmsgbox 密碼正確 else msgbox 密碼錯誤 end if 以上為 很簡單的問題 但是起碼10分把。v...