早教吧 育儿知识 作业答案 考试题库 百科 知识分享

vb.net程序设计:包括三个过程1事件过程form1用inputbox输入10个数,2函数过程求最大值,3button调用过程运用循环,显示出10个框要自己输入10个数.请兄弟姐妹们,感激不尽!

题目详情
vb.net程序设计:包括三个过程1事件过程form1用inputbox输入10个数,2函数过程求最大值,3button调用过程
运用循环,显示出10个框要自己输入10个数.
请兄弟姐妹们,感激不尽!
▼优质解答
答案和解析
整数判断还是含有小数?整数判断:
Dim A(9) As Integer
Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load
For i = 0 To 9
A(i) = Val(InputBox("输入一个数字","输入"))
Debug.WriteLine("第" & i + 1 & "个数:" & A(i))
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click
Debug.WriteLine("最大数为:" & jisuan(A))
End Sub
Private Function jisuan(ByVal shuzu() As Integer) As Integer
Dim max As Integer
For i = 0 To shuzu.Length - 1
If shuzu(i) > max Then max = shuzu(i)
Next
Return max
End Function