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

Vb:一条长度为L的铁丝,要制作一个面积最大的矩形框.填空完成程序,输入铁丝的长度L,输出矩形面积的最PrivateSubCommand1Click()DimLAsIntegerDimchangAsIntegerDimkuaiAsIntegerDimsAsInteg

题目详情
Vb:一条长度为L的铁丝,要制作一个面积最大的矩形框.填空完成程序,输入铁丝的长度L,输出矩形面积的最
Private Sub Command1_Click()
Dim L As Integer
Dim chang As Integer
Dim kuai As Integer
Dim s As Integer
Dim smax As Integer
smax = 0
L = InputBox("请输入一条铁丝的长度:")
For chang = 1 To L \ 2
For kuai = 1 To L \ 2 - chang
s = ①
If ② Then
smax = s
End If
Next kuai
Next chang
Print ③
End Sub
▼优质解答
答案和解析
①(chang/2)*(kuai/2)
②s>smax
③smax
看了Vb:一条长度为L的铁丝,要制...的网友还看了以下: