Couldn't find any error in the code. Is it the glich or where the error actually lies?

@pixeal_meat
plzz refer the following code for better understanding of the logic.
Also plzz pay attention towards the constraints.

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
    int t;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        for(int i=s.size()-1;i>=0;i--)
        {
            if(s[i]!='9')
            {
                s[i]++;
                break;
            }
            else
            s[i]='0';
        }
        if(s[0]=='0')
        cout<<1<<s;
        else
        cout<<s;
        cout<<endl;
    }

}