> 其他 >
编写程序:打印出所有的“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字立方和等于该数本身.
人气:361 ℃ 时间:2019-08-21 00:54:04
解答
vb:Private Sub Form_Click() Dim a,b,c ,x As Integer For a = 0 To 9 For b = 0 To 9 For c = 1 To 9 x=100 * c + 10 * b + a If a ^ 3 + b ^ 3 + c ^ 3 = a + 10 * b + 100 * c Then print x; Next c Next b Nex...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版