2 test cases failed

can you please check the solution where i went wrong
#include
using namespace std;
int main(){

int n;
cin>>n;
int sum = 0;
int res  = n;
while(n!=0){
	
	int rem = n%10;
	 sum += rem * rem * rem;
	 n=n/10;
	
}

if(sum==res){
	cout<<"true";
}else{
	cout<<"false";
}

}

Hi ur logic is not correct. why are u doing rem * rem * rem.
refer this code https://ide.codingblocks.com/s/582843

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.