取模运算符是% ,对负数取模不一定都是正数。例如:例一:int main(){int x;x = -6%5; printf("%2d/n",x);x = 6%-5; printf("%2d/n",x);x = 1%-5; printf("%2d/n",x);x = -1%-5; printf("%2d/n",x);x = -6%-5; printf("%2d/n",x);} 运行结果为:-1、...
取模运算符是% ,对负数取模不一定都是正数。例如:例一:int main(){int x;x = -6%5; printf("%2d/n",x);x = 6%-5; printf("%2d/n",x);x = 1%-5; printf("%2d/n",x);x = -1%-5; printf("%2d/n",x);x = -6%-5; printf("%2d/n",x);} 运行结果为:-1、...