1^3 = 1 8^3 = 512 5+1+2=8 17^3 = 4913 4+9+1+3=17 ...
请你计算包括 1,8,171,8,17 在内,符合这个性质的正整数一共有多少个?
#include "stdafx.h"
#include<stdio.h>
int main()
{
int x,y;
int i;
int count=0;
for(i=1;i<=100;i++)
{
x=i*i*i;
y=0;
while(x>0)
{
y=y+x%10;
x=x/10;
}
if(i==y)
{
count++;
}
}
printf("%d",count);
return 0;
}