Replace the number

one of my testcases is getting failed
#include
using namespace std;
int main(){
long long int n,s=0,t,i=1;
cin>>n;
while(n!=0){
t=n%10;
if(t==0){
t=5;
}
s=s+ti;
i=i
10;
n=n/10;
}
cout<<s;
}

hey @dips123deepali_c25f140838182212 you should also write for the case when the number is 0 and in the while condition it should be n>0.
https://ide.codingblocks.com/s/627889 here i have added that condition to your code is fine

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.

Thankyou sir for explanation.