题目在主页,如有出错请指出
using namespace std;
int main() { int n, x, y; cin >> n >> x >> y; if (x < y) cout << y - x << endl; else cout << max(min(n - x + y - x, 1), 0) << endl; return 0; }