My issue
not passing hidden cases
My code
#include <stdio.h>
#include<math.h>
int main() {
// your code goes here
int m,n,sum=0,rem;
int c,i=0;
scanf("%d",&n);
m=n;
c=n;
while(c>0)
{
i++;
c=c/10;
}
//count=log10(n)+1;
while (n>0)
{
rem=n%10;
sum=sum+pow(rem,i);
n=n/10;
}
if (m==sum)
printf("Amstrong");
else
printf("Not Amstrong");
}
Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klu-problem-solving/KLUPS00A/problems/LPYAS151