求四位数的偶数中,所有各位数字之和是15的倍数的数的和.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 20:20:51
求四位数的偶数中,所有各位数字之和是15的倍数的数的和.
求四位数的偶数中,所有各位数字之和是15的倍数的数的和.
求四位数的偶数中,所有各位数字之和是15的倍数的数的和.
和是 1592376
这样的数字从1068、1086、1158、1176、1194……到……9948、9966、9984共306个.
3096836,原因不知,编程算的
用编程解决,答案1303536过程是什么样的啊。怎么有两个答案啊?还有个1592376哪个是对的啊?python版: total = 0 for i in range(1000,9999,2): tmp = str(i) s = 0 for j in range(len(tmp)): s = s + int(tmp[j]) if s%1...
全部展开
用编程解决,答案1303536
收起
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer
Dim x As Long, s As Long
s = 0
For x = 1000 To 9999 Step 2
a = x \ 1000<...
全部展开
Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer, d As Integer
Dim x As Long, s As Long
s = 0
For x = 1000 To 9999 Step 2
a = x \ 1000
b = x \ 100 Mod 10
c = x \ 10 Mod 10
d = x Mod 10
If (a + b + c + d) Mod 15 = 0 Then
s = s + x
End If
Next
Print s
End Sub
收起