fun=1
t=m
do while t
題目:編寫函數(shù)fun,函數(shù)的功能是:求從m到n的乘積并顯示, '如:m為2,n為4時(shí),顯示"24" '存儲(chǔ)連乘的乘積
題目:編寫函數(shù)fun,函數(shù)的功能是:求從m到n的乘積并顯示, '如:m為2,n為4時(shí),顯示"24" '存儲(chǔ)連乘的乘積
題目:編寫函數(shù)fun,函數(shù)的功能是:求從m到n的乘積并顯示,
'如:m為2,n為4時(shí),顯示"24"
'存儲(chǔ)連乘的乘積的變量必須為Product
'要求使用Do While...Loop語(yǔ)句來(lái)實(shí)現(xiàn).
'-------------------------------------------------
'注意: 請(qǐng)?jiān)谥付ǖ氖录?nèi)編寫代碼
' 代碼只能寫在兩行標(biāo)識(shí)之間
' 不得修改已有代碼
'保存時(shí)不得修改窗體和工程文件的名稱及路徑,否則后果自負(fù).
'-------------------------------------------------
Private Function fun(m As Integer, n As Integer) As Long
Dim Product As Double, t As Integer
If m > n Then t = m: m = n: n = t
'
End Function
Private Sub Form_Load()
Show
Print fun(4, 2)
NJIT_VB
End Sub
Private Sub NJIT_VB()
Dim i As Integer
Dim a(10) As String
Dim fIn As Integer
Dim fOut As Integer
fIn = FreeFile
Open App.Path & "\in.dat" For Input As #fIn
fOut = FreeFile
Open App.Path & "\out.dat" For Output As #fOut
For i = 1 To 10 Step 2
Line Input #fIn, a(i)
Line Input #fIn, a(i + 1)
Print #fOut, Trim(Str(fun(Val(a(i)), Val(a(i + 1)))))
Next
Close #fIn
Close #fOut
End Sub
題目:編寫函數(shù)fun,函數(shù)的功能是:求從m到n的乘積并顯示,
'如:m為2,n為4時(shí),顯示"24"
'存儲(chǔ)連乘的乘積的變量必須為Product
'要求使用Do While...Loop語(yǔ)句來(lái)實(shí)現(xiàn).
'-------------------------------------------------
'注意: 請(qǐng)?jiān)谥付ǖ氖录?nèi)編寫代碼
' 代碼只能寫在兩行標(biāo)識(shí)之間
' 不得修改已有代碼
'保存時(shí)不得修改窗體和工程文件的名稱及路徑,否則后果自負(fù).
'-------------------------------------------------
Private Function fun(m As Integer, n As Integer) As Long
Dim Product As Double, t As Integer
If m > n Then t = m: m = n: n = t
'
End Function
Private Sub Form_Load()
Show
Print fun(4, 2)
NJIT_VB
End Sub
Private Sub NJIT_VB()
Dim i As Integer
Dim a(10) As String
Dim fIn As Integer
Dim fOut As Integer
fIn = FreeFile
Open App.Path & "\in.dat" For Input As #fIn
fOut = FreeFile
Open App.Path & "\out.dat" For Output As #fOut
For i = 1 To 10 Step 2
Line Input #fIn, a(i)
Line Input #fIn, a(i + 1)
Print #fOut, Trim(Str(fun(Val(a(i)), Val(a(i + 1)))))
Next
Close #fIn
Close #fOut
End Sub
其他人氣:819 ℃時(shí)間:2019-11-22 14:56:34
優(yōu)質(zhì)解答
我來(lái)回答
類似推薦
- 求25個(gè)0.4,12個(gè)0.5,24個(gè) 2.5,11個(gè)2連乘的乘積 急用!
- 編寫保留兩位小數(shù)的fun函數(shù)
- 求25個(gè)0.4 12個(gè)0.5 24個(gè)2.5 11個(gè)2連乘的乘積
- 用遞歸的方法實(shí)現(xiàn)fun函數(shù)的定義 :m,n均為正整數(shù) fun (0,n)=n+1; fun (m,0)=m+1; fun (m,n)= fun (m-1,n)
- 請(qǐng)編寫函數(shù)fun,其功能是判斷一個(gè)整數(shù)n是否為素?cái)?shù),如果是素?cái)?shù),則返回1,否則返回0.
- cosAcosB+sinAsinB=1 可得到什么
- 作文:游大夫山350字
- 計(jì)算:666×778+333×444=_.
- n個(gè)數(shù)的和的各個(gè)數(shù)位的和,等于這幾個(gè)數(shù)字各數(shù)位的和嗎
- We should _______ ______ _______them.我們應(yīng)該友好的對(duì)待他們.
- 3fe2+ +2s2o3 2- +o2+xoH-1====fe3o4+S4O6 2- +2H2O 為什么說(shuō)每生成1MOLfe3o4反應(yīng)轉(zhuǎn)移的電子數(shù)為 4MOL
- 仰角的概念
猜你喜歡
- 1英語(yǔ)翻譯
- 2中國(guó)當(dāng)前的主要矛盾,是人們?nèi)找嬖鲩L(zhǎng)的物質(zhì)和文化生活和落后的社會(huì)生產(chǎn)之間的矛盾,具體表現(xiàn)在我們生活的哪些方面呢?
- 3如圖是一個(gè)平分角的儀器,其中AB=AD,BC=DC,將點(diǎn)A放在角的頂點(diǎn),AB和AD沿著角的兩邊放正,沿AC畫一條射線AE,AE就是角平分線,請(qǐng)說(shuō)明它的道理.
- 4what are you busy ( ) i'm busy ( )my homework
- 5我賭你等不起怎么翻譯
- 61×3/1+3×5/1+5×7/1+...+99×101/1 的值
- 7沙塵暴給人類的危害
- 8求有“蒼穹”二字的詩(shī)詞成語(yǔ)
- 9四十五分之十四除以(五分之一加三分之一)
- 1026414: finally, don't panic, think about what you can achieve, not what you can't. positive thinking is important !
- 11成語(yǔ)中的名人故事的由來(lái)?
- 12向醋酸溶液中加水稀釋,參考書上說(shuō)氫離子濃度增加,這是怎么回事?