用C语言编写的一些源码示例
源代码在线查看: cpp1.c
#include
void main()
{
int iResult,a=10,b=8,c=6,d=5,e=2;
iResult=a-b-c-d;
printf("iResult=a-b-c-d\t%d\n",iResult);
iResult=a-b+c-d;
printf("iResult=a-b+c-d\t%d\n",iResult);
iResult=a+b/c/d;
printf("iResult=a+b/c/d\t%d\n",iResult);
iResult=a+b/c*d;
printf("iResult=a+b/c*d\t%d\n",iResult);
iResult=a/b*c*d;
printf("iResult=a/b*c*d\t%d\n",iResult);
iResult=a%b/c*d;
printf("iResult=a%%b/c*d\t%d\n",iResult);
iResult=a%b%c%d;
printf("iResult=a%%b%%c%%d\t%d\n",iResult);
iResult=a-(b-c)-d;
printf("iResult=a-(b-c)-d\t%d\n",iResult);
iResult=(a-(b-c))-d;
printf("iResult=(a-(b-c))-d\t%d\n",iResult);
iResult=a-((b-c)-d);
printf("iResult=a-((b-c)-d)\t%d\n",iResult);
iResult=a%(b%c)*d*e;
printf("iResult=a%%(b%%c)*d*e\t%d\n",iResult);
iResult=a+(b-c)*d-e;
printf("iResult=a+(b-c)*d-e\t%d\n",iResult);
iResult=(a+b)*c+d*e;
printf("iResult=(a+b)*c+d*e\t%d\n",iResult);
iResult=(a+b)*(c/d)%e;
printf("iResult=(a+b)*(c/d)%%e\t%d\n",iResult);
}