为啥不能输出none,就是希望那个如果范围内没有水仙花数就输出none有的话输出水仙花数就行了

img

img

for (int i = m; i <= n; i++) {
    a = i % 10;
    b = i / 10 % 10;
    c = i / 100;
    if (i == a * a * a + b * b * b + c * c * c) {
        cout << i << end1;
    }
    else {
        cout << "none" << end1;
    }
}



你试试for循环里面这样写

输入为啥要while()
return 0;呢

while(cin>>m>>n)是啥意思,直接cin>>m>>n就可以了