慕侠0398797
2018-07-29 11:02
#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;
}
//%是一个转义字符,所以跟在%后面的字符意思都被改了,所以输出有问题;最后一个改成printf("x%%y=%d\n",x%y);就好了
C语言入门
926209 学习 · 20797 问题
相似问题