题解 | #输出水仙花数#
输出水仙花数
https://www.nowcoder.com/practice/dabaf13009ef4d0cbf22302fd6a530a6
#include <iostream> using namespace std; int main() { // write your code here...... int n; int x,y,z; for(n=100;n<999;n++) { x = n / 1 % 10; y = n / 10 % 10; z = n / 100 % 10; if (n == ((x*x*x) + (y*y*y) + (z*z*z)))cout << n << endl; } return 0; }