给一个int赋最大值

根据二进制补码的性质,先使1<<31再减一即可。

int x = (1<<31)-1;

  

原文地址:https://www.cnblogs.com/Wangsheng5/p/11651244.html