输出三个数中的最大值
2012-05-18 08:40
176 查看
dim a as integer,b as integer,c as integer,max as integer
a=Val(text1.text)
b=Val(text2.text)
c=Val(text3.text)
Max = IIf(a > b,a,b)
Max = IIf(Max > c, Max,c)
print "最大数为:" & Max
今天看了一会儿书发现用IIF也能输出最大值。看来VB真的是很奇妙,一个程序可以利用多种代码编写。
以前用的是if....then .
if a>b then
max=a
else
max=b
end if
if max< c then
max=c
end if
嘿嘿!真是条条大路通罗马啊!!!
a=Val(text1.text)
b=Val(text2.text)
c=Val(text3.text)
Max = IIf(a > b,a,b)
Max = IIf(Max > c, Max,c)
print "最大数为:" & Max
今天看了一会儿书发现用IIF也能输出最大值。看来VB真的是很奇妙,一个程序可以利用多种代码编写。
以前用的是if....then .
if a>b then
max=a
else
max=b
end if
if max< c then
max=c
end if
嘿嘿!真是条条大路通罗马啊!!!
相关文章推荐
- [分支循环](补)用分支结构实现输出三个数中的最大值
- 求三个数中的最大值,以一定的格式输出
- 输入三个整数,输出三个数中的最大整数(电脑截屏)
- 第七周项目三输出三个数的最大值
- 实现三个数的大小比较,并输出最大值
- 输出三个数的最大值条件表达式及if语句
- 编程输出三个数中的最大值
- 第七周项目三—输出三个数中的最大值问题
- 函数_习题:编写一个函数输出三个数中的最大数
- 编程输出三个数中的最大值
- 第七周输出三个数中的最大的数
- 项目三 (2)输出三个数中的最大值
- 第7周项目3输出三个数中的最大值
- 输出三个数的最大值和最小值
- 4比较三个数的大小输出最大的值并从小到大排序输出
- 汇编语言编写的输出三个数的最大和最小(原创)
- 汇编语言编写的输出三个数的最大和最小(原创)
- 汇编语言编写的输出三个数的最大和最小(原创)
- WV.36-三个数的最大值
- HDU 1503 最大公共子序列,输出用到了递归