提交时间:2022-10-06 14:01:36

运行 ID: 11589

#include<bits/stdc++.h> using namespace std; #define x1 x[0] #define x2 x[1] #define x3 x[2] int x[3]; int main(){ // freopen("tmp.in", "r", stdin); cin >> x1 >> x2 >> x3; sort(x, x + 3); if(x2 - x1 == 2 || x3 - x2 == 2) cout << 1 << endl; else cout << 2 << endl; int ans = 0; ans = max(x2 - x1 - 1, x3 - x2 - 1); cout << ans; }