InnoFang
2015-08-19 20:26
#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;
}
======================
习题是让人体会一下算术运算符的用法。自己把答案算出来,那你让程序干嘛。
C语言入门
926021 学习 · 20793 问题
相似问题