test case 3 is failing ,help me to identify the error
#include
using namespace std;
int main(){
char a[50];
cin>>a;
int i;
for(i=0;a[i]!=’\0’;i++){
int digit=a[i]-‘0’;
if(digit==9);
else if((digit)>=5){
digit=9-digit;
a[i]='0'+digit; }}
cout<<a<<endl;
}