ZakenChannel

First task

Oct 7th, 2020 (edited)
1,456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int first, second, third, salary, min, max;
  7.     cin >> first >> second >> third;
  8.     if (first >= second && first >= third) {
  9.         max = first;
  10.     }
  11.     if (second >= first && second >= third) {
  12.         max = second;
  13.     }
  14.     if (third >= first && third >= second) {
  15.         max = third;
  16.     }
  17.     if (first <= second && first <= third) {
  18.         min = first;
  19.     }
  20.     if (second <= first && second <= third) {
  21.         min = second;
  22.     }
  23.     if (third <= first && third <= second) {
  24.         min = third;
  25.     }
  26.     salary = max - min;
  27.     cout << salary;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment