include
include
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector
for (int i = n - 1; i >= 0; i--)
{
char c;
cin >> c;
a[i] = c - '0';
}
if (a[n - 1] == 9)
{
for (int i = 0; i <= n; ++i)
{
b[i] = 1;
}
}
else
{
for (int i = 0; i < n; ++i)
{
b[i] = 9;
}
}
for (int i = 0; i < n; i++)
{
if (b[i] < a[i])
{
b[i + 1]--;
b[i] += 10;
}
c[i] = b[i] - a[i];
}
for (int i = n - 1; i >= 0; i--)
{
cout << c[i];
}
cout << '\n';
}
return 0;
}
标签:std,int,每日,cin,--,include From: https://www.cnblogs.com/Wind52HZ/p/18577668