kindly see the following code. it is giving error in test case 2 and 3
#include
#include<math.h>
using namespace std;
int replace(int n){
int i,j,k=0;
i=n;
int sum=0;
while(i>0){
j=i%10;
if(j==0){
j=5;
}
i=i/10;
sum=sum+(j*pow(10,k));
k++;
}
return sum;
}
int main(){
int n;
cin>>n;
cout<<replace(n);
}