fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a = 10, b = 7, c = 12;
  7. cin >> a >> b >> c;
  8. int stairs = max({a, b, c}) - min({a, b, c}) - 2;
  9. if (stairs >= 0) {
  10. cout << stairs;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5268KB
stdin
41 20 37 -> a > b && a > c
stdout
19