用3,4,5,6,7这5个数字组成一个能被22整除的五位数
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 11:05:11
用3,4,5,6,7这5个数字组成一个能被22整除的五位数
用3,4,5,6,7这5个数字组成一个能被22整除的五位数
用3,4,5,6,7这5个数字组成一个能被22整除的五位数
给你一个EXCEL VBA代码:
Sub 计算整除()
Dim Tex As String,Tex1 As String,P As Integer
P = 0
For i = 3 To 7
For J = 3 To 7
For K = 3 To 7
For l = 3 To 7
For M = 3 To 7
Tex = i & J & K & l & M
If (Val(Tex) Mod 22) = 0 And InStr(1,Tex,"3") > 0 And InStr(1,Tex,"4") > 0 _
And InStr(1,Tex,"5") > 0 And InStr(1,Tex,"6") > 0 _
And InStr(1,Tex,"7") > 0 Then
P = P + 1
Tex1 = Tex1 & Tex & Chr(10)
End If
Next
Next
Next
Next
Next
MsgBox "共有" & P & "个:" & Chr(10) & Tex1,,"计算结果"
End Sub
计算结果:
53746
54736
73546
74536
能被11整除的数的特征是奇数位的和与偶数位和的差能被11整除
最后一位是偶数
73546
74536
53746
54736
尾数为6,即能被2整除
奇数位为5、7、6和为18
偶数位3、4和为7,奇数位和-偶数位和=11 即能被11整除
所以可以是:53746
能被11整除的数的特征是奇数位的和与偶数位和的差能被11整除
最后一位是偶数
73546
53746
54736
73546
74536
53746
54736
73546
74536