然而求余得y=%d,而不是x%y=1,问题在哪呢?
#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;
}
2016-10-20
举报