标签:
#include <iostream>
using namespace std;
int main( )
{
int n,a,b,c;
for (a=1; a<=9;a++)
for (b=0; b<=9; b++)
for (c=0; c<=9; c++)
{
n=a*100+b*10+c;
if (n==a*a*a+b*b*b+c*c*c) cout<<n<<endl;
}
system("pause");
return 1;
}
#include <iostream>
using namespace std;
int main( )
{
int i,a,b,c;
for (i=100; i<=999; i++)
{
a=i/100;
b=i/10%10;
c=i%10;
if (a*a*a+b*b*b+c*c*c==i) cout<<i<<endl;
}
system("pause"); return 1;
}
标签:
原文地址:http://www.cnblogs.com/wc1903036673/p/3870534.html