package main
import "fmt"
func isOk(n int) bool {
tmp := n
a := tmp % 10
tmp /= 10
b := tmp % 10
tmp /= 10
c := tmp
if a * a * a + b * b * b + c * c * c == n {
return true
}
return false
}
func main() {
for val := 100; val <= 999; val++ {
if isOk(val) {
fmt.Println(val)
}
}
}
相关文章
- 09-28go求abc=a^3+b^3+c^3