单选题

下面程序的功能是输出100到1000中的水仙花数。则在空白处应填入(    )。

说明:若一个三位数的每一位数字的立方之和该数本身则称这个数为水仙花数。例如:因为153 = 1×1×1+5×5×5+3×3×3,所以153为水仙花数。

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

   int a,b,c;

    for (int n = 100; n <= 999; n+=1) {

        _______

        _______

        _______

        if(pow(a,3)+pow(b,3)+pow(c,3)==n){

            cout <<n <<"是水仙花数"<<endl;

        }

    }

    return 0;

}

A

a = n/100;    b = n/10%10;    c = n%10;

B

a = n/100;    b = n/10;    c = n%10;

C

a = n/100;    b = n%10;    c = n/100%10;

D

a = n%10;    b = n%100;    c = n%10/10;

赣ICP备20007335号-2