Learning course: Logic Building in C++
Problem Link: CodeChef: Practical coding for everyone
Feedback
// The code below is incorrect. Debug this code to solve the problem.
include
using namespace std;
int main() {
int x,y;
cin>>x>>y;
int a=x/10;
cout << "a : " << a << endl;
int b=y/10;
cout << "b : " << b << endl;
if(x%10==0){
cout << "x : " << x << endl;
cout << "a : " << a << endl;
a=a-1;
cout << "after a : " << a << endl;
}
if(y%10==0){
cout << "y : " << y << endl;
cout << "b : " << b << endl;
b=b-1;
cout << "after b : " << b << endl;
}
cout << "a : " << a << endl;
cout << "b : " << b << endl;
cout<<abs(a-b)<<endl;
}