#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; }
因为最后的得数符号要跟被取余数相同,也就是跟10的符号相同,即为正号
求余是 3