Advertisement
Josif_tepe

Untitled

Dec 16th, 2023
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int a, b, c;
  6.     cin >> a >> b >> c;
  7.    
  8.     int p1 = abs(b - a) * 10 + abs(c - a) * 10;
  9.     int p2 = abs(a - b) * 10 + abs(c - b) * 10;
  10.     int p3 = abs(a - c) * 10 + abs(b - c) * 10;
  11.    
  12.     int rez = min(p1, min(p2, p3));
  13.     cout << rez << endl;
  14.     return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement