Help me in solving LPYAS151 problem

My issue

explain

My code

#include<stdio.h>
#include<math.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(sum==temp){
        printf("Armstrong");
    }else{
        printf("Not Armstrong");
    }
    return 0;

}


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