下面哪些定义是类型正确的?
A: f :: (Integer, Integer) - Floatf (x,y) =x / y
B: f :: (Integer, Integer) - Floatf (x,y) = (fromInteger x) / (fromInteger y)
C: f :: (Integer, Integer) - Floatf (x,y) = 3*x + y
D: f :: (Integer, Integer) - Integerf (x, y) = 3*x + y
A: f :: (Integer, Integer) - Floatf (x,y) =x / y
B: f :: (Integer, Integer) - Floatf (x,y) = (fromInteger x) / (fromInteger y)
C: f :: (Integer, Integer) - Floatf (x,y) = 3*x + y
D: f :: (Integer, Integer) - Integerf (x, y) = 3*x + y
举一反三
- Sub s1(ByVal x As Integer, ByVal y As Integer) Dim t As Integer t = x: x = y: y = t End Sub Sub s2(x As Integer, y As Integer) Dim t As Integer t = x: x = y: y = t End Sub 则以下说法中正确的是( )。
- 在VB中,使用变量前一般应对变量进行定义。以下变量定义语句错误的是()。 A: Dim x As Integer B: Dim x As Integer,y As Single C: Var x,y:Integer D: Dim x As Integer,y As Integer
- 下列代码执行后,窗体上显示( )。 Dim x As Integer, y As Integer x = 50: y = 30 If x > y Then x = x - y Else y = y x If x < y Then x = x 20 Form1.Print x, y
- 下面可以正确定义2个整形变量和一个字符型变量的语句是() A: Dim x%, y As Integer, n As String B: Dim x As Integer, y, n As String C: Dim x, y As Integer, n As String D: Dim x%, y$, n As String
- 执行下列程序段后,变量y的值为( )。 Dim x As Integer,y As Integer x = 7 y = 3 If x >= 10 Then y = x - y ElseIf x>= 7 Then y = x + y Else y = x End If A: 21 B: 10 C: 4 D: 3