Chewbacca and number using continue

in my code if i put the a[0]==9 condition inside the for loop and use continue, it doesn’t work. But if i place it outside the loop it works. Why is this happening?

#include
using namespace std;
int main() {
string n;
cin>>n;
for(int i=0;n[i]!=’\0’;i++)
{
if(n[0]==9)
{continue;}
else if((‘9’-n[i])<(n[i]-‘0’))
{
n[i]=‘9’-n[i]+‘0’;
}
}
cout<<n;
}
this is my code which doesn’t work.

Plz send your code by saving on ide.