Https://hack.codingblocks.com/contests/c/123/62

https://hack.codingblocks.com/contests/c/123/62

Please tell me what is error in my solution
#include
using namespace std;
int main() {
char number[20];
cin>>number;

for(int i=0;number[i]!='\0';i++){
    if(number[i]=='9' && i==0)
        i++;

    if(number[i]>='5'&&number[i]<='9'){
        number[i]='9' - number[i];
    }

}

cout<<number<<endl;

return 0;

}

Handle this separately
Input:
9
Output:
0