以下是使用 C++编写的程序来找出所有的水仙花数: ```cpp #include <iostream> using namespace std; int main() { for (int num = 100; num <= 999; num++) { int hundreds = num / 100; int tens = (num % 100) / 10; int units = num % 10; if (num == (hundreds * hundreds * hundreds + tens * tens * tens + units * units * units)) { cout << num << " "; } } return 0; } ``` [2024-10-15 21:53:45 | AI写代码神器 | 147点数解答]