作业帮 > 数学 > 作业

问几道VB的题目!6\x05"求方程8x-5y=3,在|x|

来源:学生作业帮 编辑:大师作文网作业帮 分类:数学作业 时间:2024/11/19 02:07:38
问几道VB的题目!
6\x05"
求方程8x-5y=3,在|x|
问几道VB的题目!6\x05
Private Sub Form_Click()
Dim x,y,z As Integer
For x = -150 To 150
For y = -100 To 100
If 8 * x - 5 * y = 3 Then
z = z + 1
End If
Next
Next
Print "答案共有"; z; "组"
End Sub
------------------
Private Sub Form_Click()
Dim i,j,k,l,m,n,Z As Long
For i = 1 To 9
For j = 0 To 9
For k = 0 To 9
For l = 0 To 9
For m = 0 To 9
If i * i + j * j + k * k + l * l + m * m = 110 Then
n = i * 10000 + j * 1000 + k * 100 + l * 10 + m
If n > Z Then
Z = n
End If
End If
Next
Next
Next
Next
Next
Print "最大的五位数是:"; Z
End Sub
再问: 谢谢,谢谢!冒昧的问句:还能帮帮忙吗?
再答: 我晕,好吧 '所谓回文数是从左至右与从右至左读起来都是一样的数字,如:121是一个 '回文数。编写程序,求在500-900的范围内所有能被3整除的回文数的个数。 Private Sub Form_Click() Dim i, j, k, z As Integer For i = 5 To 8 For j = 0 To 9 z = i * 100 + j * 10 + i If z Mod 3 = 0 Then Print z k = k + 1 End If Next Next Print k End Sub '已知A,B为正整数, A