Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
405 B
2
Indexable
Never
#include <iostream>
#include <algorithm>

using namespace std;

int main(){

    freopen("GAMES1.INP","r",stdin);
    freopen("GAMES1.OUT","w",stdout);

    int m[3];
    for(int i = 0; i < 3; i++) cin >> m[i];
    sort(m, m+3);
    int a = m[0], b = m[1], c = m[2];
    if(c-b > b-a){
        cout << c-b-1 << endl;
        return 0;
    }
    cout << b-a-1 << endl;

    return 0;
}
Leave a Comment