fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c;
  6. cin >> a >> b >> c;
  7. if (a < b) {
  8. swap(a, b);
  9. }
  10. if (a < c) {
  11. swap(a, c);
  12. }
  13. if (b < c) {
  14. swap(b, c);
  15. }
  16. cout << a - c;
  17. return 0;
  18. }
  19.  
  20. // sau manual-
  21. // if (a < b) {
  22. // int aux = a;
  23. // a = b;
  24. // b = aux;
  25. // }
Success #stdin #stdout 0s 5300KB
stdin
2 5 9
stdout
7