两个数比较大小,三个数比较大小,十个数比较大小,并输出最大数
2012-04-28 21:45
351 查看
两个数的大小
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
a = 44
b = 36
If a >= b Then
Print a
Else
Print b
End If
End Sub
三个数的大小
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = 44
b = 36
c = 9
If a > b Then
Max = a
Else
Max = b
End If
If c > Max Then
Max = c
End If
Print Max
End Sub
比较10个数的大小
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim f As Integer
Dim g As Integer
Dim h As Integer
Dim i As Integer
Dim j As Integer
a = 44
b = 36
c = 9
d = 5
e = 345
f = 1
g = 89
h = 60
i = 53
j = 120
If a > b Then
Max = a
Else
Max = b
End If
If c > Max Then
Max = c
End If
If d > Max Then
Max = d
End If
If e > Max Then
Max = e
End If
If f > Max Then
Max = f
End If
If g > Max Then
Max = g
End If
If h > Max Then
Max = h
End If
If i > Max Then
Max = i
End If
If j > Max Then
Max = j
End If
Print Max
End Sub
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
a = 44
b = 36
If a >= b Then
Print a
Else
Print b
End If
End Sub
三个数的大小
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = 44
b = 36
c = 9
If a > b Then
Max = a
Else
Max = b
End If
If c > Max Then
Max = c
End If
Print Max
End Sub
比较10个数的大小
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim f As Integer
Dim g As Integer
Dim h As Integer
Dim i As Integer
Dim j As Integer
a = 44
b = 36
c = 9
d = 5
e = 345
f = 1
g = 89
h = 60
i = 53
j = 120
If a > b Then
Max = a
Else
Max = b
End If
If c > Max Then
Max = c
End If
If d > Max Then
Max = d
End If
If e > Max Then
Max = e
End If
If f > Max Then
Max = f
End If
If g > Max Then
Max = g
End If
If h > Max Then
Max = h
End If
If i > Max Then
Max = i
End If
If j > Max Then
Max = j
End If
Print Max
End Sub
相关文章推荐
- 比较三个整数大小,输出最大值
- Java比较两个数字或者三个数字之间的大小
- 两个数与三个数比较输出最大值编程
- 不用比较运算符实现两个整数的大小比较并输出结果
- 任给三个数字a,b,c,比较大小按照从大到小顺序输出
- 输入任意大小的三个整数,判断其中是否有两个奇数一个偶数。若是,则输出“YES”,不是则输出“NOT” (要求用条件表达式进行判断,不使用if语句)
- 三个数比较大小,最大的显示在屏幕上
- 比较三位数大小,输出最大的一个
- 汇编 输入几个数子进行比较 不同条输出不同的结果 三个相同输出2 两个同输出1 不同输出0
- 比较三个字符串的大小,最后按从小到大的顺序输出
- 比较两个数的大小,输出最大值
- 三个数比较大小,找最大值的代码实现
- 5.编写一个程序,有两个类,其中类MAX中具有两个方法,方法名都是max,一个方法能够比较两个数的大小,另外一个方法能够比较三个数的大小。在另外一个类中创建对象,调用这两个方法,分别输出两组数:2、6
- 比较三个数,输出最大值
- 实现三个整数数a,b,c的比较大小,并且按大到小的顺序输出
- 不用比较运算符实现两个整数的大小比较并输出结果
- 第五周项目二(2)比较三个数,输出最大值
- 比较两个日期大小和获取当前月最大天数的存储过程
- 实现三个数的大小比较,并输出最大值