fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b; cin >> a >> b;
  6.  
  7. if (a == b) cout << 1;
  8. else if (abs(a-b) % 2 == 0) cout << 3;
  9. else cout << 2;
  10. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
2