代码
#include <stdio.h>
int main()
{
int i,j,k,n;
int sum = 0;
for(n=100;n<1000;n++)
{
i=n/100;
j=n/10-i*10;
k=n%10;
if(n == i*i*i+j*j*j+k*k*k){
sum += n;
}
}
printf("%d\n", sum);
return 0;
}
#include <stdio.h>
int main()
{
int i,j,k,n;
int sum = 0;
for(n=100;n<1000;n++)
{
i=n/100;
j=n/10-i*10;
k=n%10;
if(n == i*i*i+j*j*j+k*k*k){
sum += n;
}
}
printf("%d\n", sum);
return 0;
}