#include<iostream>
using namespace std;
int main()
{
int s,t,h;
int Armstrong;
for(Armstrong=100;Armstrong<=999;Armstrong++)
{
s=Armstrong%10;
t=(Armstrong%100)/10;
h=Armstrong/100;
if(s*s*s+t*t*t+h*h*h==Armstrong) cout<<Armstrong<<endl;
}
return 0;
}
c++找三位整数中的阿姆斯壮数
最新推荐文章于 2022-12-14 22:58:28 发布