Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- int main() {
- int first, second, third, salary, min, max;
- cin >> first >> second >> third;
- if (first >= second && first >= third) {
- max = first;
- }
- if (second >= first && second >= third) {
- max = second;
- }
- if (third >= first && third >= second) {
- max = third;
- }
- if (first <= second && first <= third) {
- min = first;
- }
- if (second <= first && second <= third) {
- min = second;
- }
- if (third <= first && third <= second) {
- min = third;
- }
- salary = max - min;
- cout << salary;
- }
Advertisement
Add Comment
Please, Sign In to add comment