水仙花数:num = 各个数的立方和
#include <iostream> using namespace std; int main() { int num = 100; do{ int one = num % 10; int two = num /10 % 10; int three = num /100 ; if(one * one * one + two * two * two + three * three * three == num){ cout<< num <<" ,是水仙花树"<< endl; } num ++; }while (num < 1000); return 0; }