用C++求解水仙花数

(1)下面程序是求解水仙花数。水仙花数:3位数中各位数的立方和等于该3位数,如153=13+53+33。将以下程序填写完整,在C语言程序集成开发环境中运行程序,观察运行结果。
#include#includeint main(void)
int n,j,number;
double product; /product 为三位数字中各位的立方和/
printf("水仙花数:\n");
for(n=100;n<1000;①){
product=0;
number=n;
do{
product=product+pow(j,3);
number=number/10;
}while(
if(n==product)
printf("%d\n",n);
6~∞91011121314151617181920
return
阅读完程序后,请补好括号部分缺失的语句。
填空①:
填空②:
填空③:

2和3在哪里呢?代码如下,自己比对填一下吧:

#include <iostream>
#include <cmath>
using namespace std;
 
int main(int argc, const char * argv[]) {
    int n, unit, ten, hund; // unit, ten, hund分别存储个位、十位和百位的数字
    
    for(n = 100; n < 1000; n++) {
        unit = n % 10; // 得到n的个位数字
        ten = (n / 10) % 10; // 得到n的十位数字
        hund = n / 100; // 得到n的百位数字
        // 判断各位数字的立方和是否等于它本身
        if(n == hund * hund * hund + ten * ten * ten + unit * unit * unit)
        // if(n == pow(hund, 3) + pow(ten, 3) + pow(unit, 3))
            cout << n << " ";
    }
    cout << endl;
    return 0;
}