Help me in solving LPYAS151 problem

My issue

output is correct. But when submitted showing failed on hidden test case

My code

#include <stdio.h>

int main() {
	// your code goes here
int n,r,sum=0,temp;
scanf("%d",&n);
temp=n;
while(n!=0){
   r=n%10;
   sum=sum+r*r*r;
   n=n/10;
}
if(temp==sum)
printf("Armstrong\n");
else
printf("Not Armstrong\n");
}


Learning course: Algorithmic Problem Solving
Problem Link: https://www.codechef.com/learn/course/klu-problem-solving/KLUPS00A/problems/LPYAS151