freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[醫(yī)學(xué)]第四章函數(shù)和過程-資料下載頁

2024-10-16 17:57本頁面
  

【正文】 省略維數(shù) 函數(shù)返回一個(gè)值 Private Function tim(n( ) As Integer) Dim t%, i% t = 1 For i = LBound(n) To UBound(n) t = t * n(i) Next i tim = t End Function 數(shù)組作形參 省略維數(shù) 例 4- 9 編制 sub過程,用于在數(shù)組中找出最大值、 最小值。 習(xí)題:設(shè) function pd()是自定義函數(shù) 。函數(shù)被調(diào)用多次, 請(qǐng)仔細(xì)分析每次調(diào)用后有關(guān)變量的變化。 Function pd(ByVal x as Integer,y as Integer) As integer Dim m as Integer Dim n as Integer m=x+y : x=x+1 y=y+1: n=xy print “m=“。m?!眡=”。x 。”y=”。y _ 。”n=”。n pd=n End Function Sub Form_click() Dim a as integer,b as integer Dim c as integer,d as integer a=2:b=3:c=0 d=pd(a,b) print “a=”。a,”b=“。b d=pd(a,b) print “a=“。a,”b=“。b d=pd(a+b,c) print “a=“。a,”b=”。b End sub (1)當(dāng)?shù)谝淮握{(diào)用函數(shù) pd時(shí),實(shí)在參數(shù) a 取代形式 參數(shù) x,形式參數(shù) y 等于實(shí)在參數(shù) b的地址,即 x=2 、 y= y是地址傳遞,所以 m=x+y相當(dāng)于 m=x+b 、 y=y+1相當(dāng)于 b=b+1,那么語句執(zhí)行結(jié)果為: m=5 x=3 y=4 n=1 返回主程序后,輸出 a=2 b=4 由此可見,值傳遞時(shí),參數(shù)值在子程序中的變化不影 響;而地址傳遞時(shí),參數(shù)值在子程序中的任何變化都 會(huì)返回給調(diào)用該子程序的實(shí)在參數(shù)。 (2) 第二次調(diào)用函數(shù) pd時(shí),形式參數(shù) x仍然等于2 、形式參數(shù) y等于實(shí)在參數(shù) b的地址,即 x= Y=b(b=4).輸出結(jié)果為: M=6 x=3 y=5 n=2 返回主程序后,輸出 : a= 2 b=5 (3) 第三次調(diào)用函數(shù) pd時(shí),形式參數(shù) x 等于 a+b、 形式參數(shù) y等于實(shí)在參數(shù) c的地址,即 x= y=c (c=0)。輸出結(jié)果為: m=7 x=8 y=1 n=7 返回主程序后,輸出 a=2 b=5 (a 、 b的值保持不變 ) 判斷下列過程定義語句的正誤并改正。 (1) private sub A1(x()) as integer (2) Public sub A1 (3) Private function F1( a as integer, b as integer) 已知 public function F( x1 as integer ,x2 as integer) As integer 和 private sub S (x as integer),判斷下列調(diào) 用過程的語句的正誤。 (1)a=S(b) (2) Call S b (3) S b C=F(a,b) p103第 3題。
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1