int l = Int32.MaxValue;//2147483647
int r = Int32.MaxValue;//2147483647
Console.WriteLine((l + r)/2);//-1
Console.WriteLine(l + (r - l) / 2);//2147483647
转载于:https://www.cnblogs.com/xiejunzhao/p/50e7d0bf713488b92e4379187576454b.html
int l = Int32.MaxValue;//2147483647
int r = Int32.MaxValue;//2147483647
Console.WriteLine((l + r)/2);//-1
Console.WriteLine(l + (r - l) / 2);//2147483647
转载于:https://www.cnblogs.com/xiejunzhao/p/50e7d0bf713488b92e4379187576454b.html