#include <stdio.h>
int countdig(int num)
{
int count=0;
while(num)
{
num=num/10;
count++;
}
return count;
}
int powsum(int n,int count)
{
int sum=0;
while(n)
{
int i,prod=1;
for(i=1;i<=count;i++)
{
prod = prod * (n%10);
}
sum = sum+prod;
n = n/10;
}
return sum;
}
int main(void) {
int i,a,b;
printf("Enter starting and ending num: \n"); for(i=a+1;i<b;i++)
{
int count,res;
count = countdig(i);
res = powsum(i,count);
if(res==i)
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBjb3VudGRpZyhpbnQgbnVtKQp7CglpbnQgY291bnQ9MDsKCXdoaWxlKG51bSkKCXsKCQludW09bnVtLzEwOwoJCWNvdW50Kys7Cgl9CglyZXR1cm4gY291bnQ7Cn0KCmludCBwb3dzdW0oaW50IG4saW50IGNvdW50KQp7CglpbnQgc3VtPTA7Cgl3aGlsZShuKQoJewoJCWludCBpLHByb2Q9MTsKCQlmb3IoaT0xO2k8PWNvdW50O2krKykKCQl7CgkJCXByb2QgPSBwcm9kICogKG4lMTApOwoJCX0KCQlzdW0gPSBzdW0rcHJvZDsKCQluID0gbi8xMDsKCX0KCXJldHVybiBzdW07Cn0KCmludCBtYWluKHZvaWQpIHsKCWludCBpLGEsYjsKCXByaW50ZigiRW50ZXIgc3RhcnRpbmcgYW5kIGVuZGluZyBudW06IFxuIik7CglzY2FuZigiJWQlZCIsJmEsJmIpOwoJZm9yKGk9YSsxO2k8YjtpKyspCgl7CgkJaW50IGNvdW50LHJlczsKCQljb3VudCA9IGNvdW50ZGlnKGkpOwoJCXJlcyA9IHBvd3N1bShpLGNvdW50KTsKCQlpZihyZXM9PWkpCgkJCXByaW50ZigiJWQgIixpKTsKCX0KCXJldHVybiAwOwp9Cg==