#include <stdio.h>
int main()
{
int 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",7 );
printf("x-y=%d\n", 13 );
printf("x*y=%d\n", -30 );
printf("x/y=%d\n", -3 );
printf("x%y=%d\n", 1 );
return 0;
}
======================
习题是让人体会一下算术运算符的用法。自己把答案算出来,那你让程序干嘛。