fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  5. #define ll long long
  6. #define loop(n) for(int i=0;i<n;i++)
  7. #define YES cout<<"YES"
  8. #define NO cout<<"NO"
  9. #define Yes cout<<"Yes"
  10. #define No cout<<"No"
  11. #define yes cout<<"yes"
  12. #define no cout<<"no"
  13. #define ef else if
  14. #define dd double
  15.  
  16. ll factorial(ll n)
  17. {
  18. if (n == 0 || n == 1)
  19. return 1;
  20. return n * factorial(n - 1);
  21. }
  22.  
  23. int main()
  24. {
  25. fio;
  26. int x1,x2,x3;
  27. cin >> x1 >> x2 >> x3;
  28. int arr[3] {x1,x2,x3};
  29. sort(arr,arr+3);
  30. cout << abs(arr[0] - arr[1]) + abs(arr[2] - arr[1]);
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
1793882912