#include<stdio.h>
#include<math.h>
int main()
{
int i = 0;
for (i = 0; i < 1000; i++)
{
int tmp = i;
int sum = 0;
int count = 0;
while (tmp)
{
count++;
tmp = tmp / 10;
}
tmp = i;
while (tmp)
{
sum = sum + pow((tmp % 10), count);
tmp = tmp / 10;
}
if (sum == i)
{
printf("%d ", i);
}
return 0;
}
#include<math.h>
int main()
{
int i = 0;
for (i = 0; i < 1000; i++)
{
int tmp = i;
int sum = 0;
int count = 0;
while (tmp)
{
count++;
tmp = tmp / 10;
}
tmp = i;
while (tmp)
{
sum = sum + pow((tmp % 10), count);
tmp = tmp / 10;
}
if (sum == i)
{
printf("%d ", i);
}
}
printf("\n");
return 0;
}