One test case is not passing Chewbacca and number problem

#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
long i;
for(i=0;s[i]!=’\0’;i++){

   if(s[0]=='9')
      continue;
    else{
    
         int temp = s[i] - '0';
         if(temp >=5)
            temp = 9 - temp;
            s[i] = temp + '0';
         }
 }
 cout<<s<<endl;

return 0;
}

Hi, Sourabh
Your code doesn’t work with inputs starting from ‘9’. Check this condition
if(s[0]==‘9’)
continue
You can work it out yourself…

Correct Vaibahv ,after posting the query yesterday i got my mistake resolved at the very next moment .By the way thanks

Good job @LP-OL0014 Vaibhav :slight_smile: