Problem : https://www.codechef.com/problems/PALL01

Although this code can be done successfully by reversing the integer digits but I tried submitting it using another approach. Can anyone tell me what is wrong with this code?

#include < iostream >

using namespace std;

int main() {

// your code goes here

int test_cases, checknum;

int t=0;

cin>>test_cases;

for(t=0;t<test_cases;t++){

cin>>checknum;

int x=0, temp, wins=0;

if(checknum>=10 && checknum<=99){

temp=checknum%10;

x=checknum/10;

if(x==temp){

wins=1;

}

}

else if(checknum>=100 && checknum<=999){

temp=checknum%10;

x=checknum/100;

if(x==temp){

wins=1;

}

}

else if(checknum>=1000 && checknum<=9999){

temp=checknum%100;

x=checknum/100;

if(x==temp){

wins=1;

}

}

else if(checknum>=1 && checknum<=9){

wins =1;

}

if(wins==1)

cout<<â€świns\nâ€ť;

else

cout<<â€ślosses\nâ€ť;

}

return 0;

}