程序代码:
//用下面的代码运行一下,看着输出自己分析,学学这种方法
#include<stdio.h>
int main()
{
int i, a, b, c, d, f[4];
for(i = 0; i < 4; i++)
scanf("%d", &f[i]);
for(i = 0;i < 4; i++)
{
printf("f[%d] = %d \n",i,f[1]);
}
a = f[0] + f[1] + f[2] + f[3];
printf("a = f[0] + f[1] + f[2] + f[3]: a = %d\n",a);
a = a / f[0];
printf("a = a / f[0]: a = %d\n",a);
b = f[0] + f[2] + f[3];
printf("b = f[0] + f[2] + f[3]: b = %d\n",b);
b = b / a;
printf("b = b / a : b = %d\n",b);
c = (b * f[1] + a) / f[2];
printf("c = (b * f[1] + a) / f[2] : c = %d \n",c);
d = f[(b / c ) % 4];
printf("d = f[(b / c ) % 4] : d = %d\n",d);
printf("\n\n\n");
printf("f[(a + b + c + d) % 4] = %d\n",f[(a + b + c + d) % 4]);
printf("f[2] = %d \n",f[2]);
if(f[(a + b + c + d) % 4] > f[2])
printf("f[(a + b + c + d) % 4] > f[2]");
printf("%d\n", a + b);
else
printf("f[(a + b + c + d) % 4] < f[2]");
printf("%d\n", c + d);
return 0;
}