Please help me with this code (TTENIS)

Here is my code: Solution
The expected output is also produced and the limits of the variables is also satisfied. The output format is also correct. Is it that we don’t have to print leading zeros? Please help me with the code.
Thanks a lot!

If last character of string is 1 then chef wins

Here is an easy soln for it

You can look at the editorial for full detail

https://discuss.codechef.com/questions/71404/ttenis-editorial

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    int t;    
    cin>>t;    
    while (t--)    
    {    
        string s;    
        cin >> s;    
        cout << (s[s.length()-1] == '1' ? "WIN\n" : "LOSE\n");    
    }
}

Dear, please read input constraints explicitly. The length of string (i.e. number of matches) can be upto 100.

So your if-else conditions-

if(chef==10&&opp==10)
					flag=true;
				else if(chef==11&&opp<11&&!flag)
					System.out.println("WIN");
				else if(opp==11&&chef<11&&!flag)
					System.out.println("LOSE");

Will all malfunction. I think your code would print nothing for cases when S~100, although I didnt check that.