My 2 test cases are not running pls help to rectify he mistake

#include
#include<math.h>
using namespace std;
int convert0to5(int a){
int z,ans=0,i=0;
while(a!=0){
z=a%10;
if(z==0){
z=5;
}
ans = ans+ (z*pow(10,i));
i++;
a/=10;
}
return ans;
}

int main(){
long long int n;
cin>>n;
cout<<convert0to5(n);
}
i have sent the code for reference

hi @prabhsim2627_d56bfdda3da10bc9 updated and commented

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.