Untitled
unknown
plain_text
2 years ago
405 B
10
Indexable
#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;
}Editor is loading...
Leave a Comment