#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; } 要想输出x%y,在printf里面需要多加一个%,这涉及到转义字符的知识
http://www.cnblogs.com/emanlee/archive/2010/04/26/1721275.html