验证中...
gistfile1.txt
Raw Copy
#include <stdio.h>
int main()
{
int n,x[100],a,b,c,i=0,k,j=0,y[100],l=0,m;
for(n=100;n<1000;n++)
{
a=n/100;
b=n/10%10;
c=n%10;
if(n==a*a*a+b*b*b+c*c*c)
{
x[i]=n;
i++;
}
}
while(1)
{
scanf("%d",&k);
if (k==0)
break;
y[j]=k;
j++;
}
while(y[l]!=NULL)
{
if(y[l]>i+1)
printf("0\n");
else
{
m=y[l];
printf("%d\n",x[m-1]);
}
l++;
}
return 0;
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search