为何取余出现问题,加减乘除可以运行得到结果?
#include <stdio.h> int main() { int x,y; x = 10; y = -3; printf("x+y=%d\n", x+y ); printf("x-y=%d\n", x-y ); printf("x*y=%d\n", x*y ); printf("x/y=%d\n",x/y ); printf("x%y=%d\n", x%y ); return 0; }
#include <stdio.h> int main() { int x,y; x = 10; y = -3; printf("x+y=%d\n", x+y ); printf("x-y=%d\n", x-y ); printf("x*y=%d\n", x*y ); printf("x/y=%d\n",x/y ); printf("x%y=%d\n", x%y ); return 0; }
2017-10-22
举报