Ciel and A-B Problem Problem Code: CIELAB

Can Anyone please Explain Why this code is wrong For this Question??

#include
using namespace std;
int Change_Digit(int n)
{
int rem = n % 10;
n /= 10;
return n * 10 + (9 - rem);
}
int main() {
int a, b;
cin >> a >> b;
cout << Change_Digit(a - b);
return 0;
}

#include
using namespace std;
int Change_Digit(int n)
{
if(n==9)
return 1;
int rem = n % 10;
n /= 10;
return n * 10 + (9 - rem);
}
int main() {
// #ifndef A
// freopen(“input.txt”, “r”, stdin);
// freopen(“output.txt”, “w”, stdout);
// #endif
int a, b;
cin >> a >> b;
cout << Change_Digit(a - b);
return 0;
}

for n=9 it should give some number other than zero
because leading zeros are not allowed