Advertisement
Josif_tepe

Untitled

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