Help me in solving LBCC21 problem

My issue

My code

// Update the code below to solve this problem

#include <stdio.h>
int main() 
{
  int t;
  scanf("%d",&t); 
  while(t--)
  {
  int P,a,x,y,z;
  scanf("%d",&P);
    x=P%10;
    y=abs(P/100);
    z=(abs(P/10))%10;
    a=(x+y)-z;
    printf("%d\n",a);
   }
return 0;
}

Learning course: Solve Programming problems using C
Problem Link: CodeChef: Practical coding for everyone