位移算法,正數轉負數,負數轉正數都可以

int turn(int a)
{
    a = ~a + 1;
    return a;
}

posted @ 2018-06-23 22:16  孜然风味  阅读(212)  评论(0编辑  收藏  举报