My issue
My code
# cook your dish here
T=int(input())
for i in range(T):
A=input()
X=int(A[0])
Y=int(A[2])
print(X-Y)
Problem Link: TAXSAVING Problem - CodeChef
# cook your dish here
T=int(input())
for i in range(T):
A=input()
X=int(A[0])
Y=int(A[2])
print(X-Y)
Problem Link: TAXSAVING Problem - CodeChef
Try changing A[2]to A[1] and index of array start as 0,1,2…
I used C++ language.
Hope it helps, Thank you.
</>
using namespace std;
int main()
{
int T;
cin>> T; //number of test case
int b[T][2];
for(int j=0; j<T; j++)
{for(int i=0; i<2; i++)
{cin>>b[j][i];
}
}
for(int j=0; j<T; j++)
{int a = b[j][0]- b[j][1] ;
cout<<a<<endl;}
return 0;
}