给定的求三位数阿姆斯特朗数的C++程序输出包含下列选项中的哪组数字?
#include<iostream>
using namespace std;
int main(){
int g,s,b;
for(int n=100;n<1000;n++)
{
b = n / 100;
s = n / 10 % 10;
g = n % 10;
if(g*g*g+s*s*s+b*b*b==n)
{
cout<<n<<endl;
}
}
return 0;
}
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析