Give solution to this

Given a integer as a input and replace all the ‘0’ with ‘5’ in the integer

Input Format
Enter an integer n

Constraints
0<=n<=1000000000000

Output Format
All zeroes are replaced with 5

Sample Input
102
Sample Output
152
Explanation
Check each digit , if it is nonzero, then no change required but if it is zero then replace it by 5.

hi @hridyansh28_cff82018adc2f216,
take a string input and iterate replace every 0 with 5, simple

#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	cin>>s;
	int n = s.length();
	for(int i=0;i<n;i++){
		if(s[i] == '0')s[i] = '5';
	}
	cout<<s<<endl;
}