本帖最后由 CrLf 于 2012-6-16 23:51 编辑
有几题看不懂,所以暂时没做,以下是数学表达式题:- Option Explicit
-
- Dim x,a,b,c,e
- x = 1
- a = 2
- b = 3
- c = 4
- e = 5
-
- MsgBox(x*(x*(x*(a*x+b)+c)+c)+e)
-
- MsgBox(Log(a*a+2*a*b+b))
-
- Const PI=3.14159265758
-
- MsgBox(Sqr(1+PI/2*Cos(48*180/PI)))
复制代码 以下是预测结果题:- Option Explicit
-
- Dim str
-
- str = "Int(-1234.5678)=-1235:" & Int(-1234.5678) & vbcrlf
- str = str & "Fix(1234.5678)=1235:" & Fix(1234.5678) & vbcrlf
- str = str & "Abs(-100)=100:" & Abs(-100) & vbcrlf
- str = str & "Sqr(sqr(16))=2:" & Sqr(sqr(16)) & vbcrlf
- str = str & "Mid(""Visual Basic Scripting"",8,5)=asic :" & Mid("Visual Basic Scripting",8,5) & vbcrlf
- str = str & "Month(now)=6:" & Month(now) & vbcrlf
- str = str & "Cint(1234.5678)=1234:" & Cint(1234.5678) & vbcrlf
- str = str & "Sgn(-100)=-1:" & Sgn(-100) & vbcrlf
- str = str & "InStr(1,""Visual Basic Scripting"",""Basic"")=8:" & InStr(1,"Visual Basic Scripting","Basic") & vbcrlf
-
- MsgBox str
复制代码 手册看得不够认真...
顺便说一下,预测结果题中原题有几处用的是全角引号,望修正 |