Help me in solving LPYAS151 problem

My issue

i need to know the failed test case

My code

#include <bits/stdc++.h>

int main() {
    int n;
	std::cin >>n;
	int count=0;
	int ans=0;
	while(n>0){
	    n=n/10;
	    count++;
	}
	while(n>0){
	    int dig=n%10;
	    int pow=1;
	    for(int i=1;i<=count;pow++){
	        pow=pow*dig;
	    }
	    ans=ans+pow;
	}
	if(ans==n){
	    std::cout <<"Armstrong" <<std::endl;
	}
	else{
	    std::cout <<"Not Armstrong" <<std::endl;
	}
}

Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300B/problems/LPYAS151