can any tell me what wrongs with my piece of code, I mean the given test cases it passes but while submitting it shows wrong answer.

#include

using namespace std;

int sum_of_1_and_last_digit(long long int X)

{

int sum=0,last=0,number=X;

//storing the last digit

last = number%10;

// while loop for calculating the first digit

while(X>0)

{

X=X/10;

if (X/10 == 0)

break;

```
}
sum =last+X;
return sum;
```

}

int main ()

{

int T;

long long int N;

cin>>T;

```
for(int i=0;i<T;i++)
{
cin>>N;
cout<<sum_of_1_and_last_digit(N)<<endl;
}
```

return 0;

}