Ciel and A-B Problem

what’s wrong in this code?

using namespace std;
int main()
{

int a,b;

cin>>a>>b;

if(((a-b)%2)==0)
cout<<a-b+1;
else
cout<<a-b-1;
return 0;
}

thanks.

try this test case:

2 1
Your answer : 0 ; which is not a positive integer
1 Like