C语言解读方法,一窍不通#includeint main(){int i,a,b,c,d,f[4];for(i = 0; i < 4; i++)scanf("%d",&f[i]);a = f[0] + f[1] + f[2] + f[3];a = a / f[0];b = f[0] + f[2] + f[3];b = b / a;c = (b * f[1] + a) / f[2];d = f[(b / c ) % 4];if(f[(a + b + c +
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 05:24:17
C语言解读方法,一窍不通#includeint main(){int i,a,b,c,d,f[4];for(i = 0; i < 4; i++)scanf("%d",&f[i]);a = f[0] + f[1] + f[2] + f[3];a = a / f[0];b = f[0] + f[2] + f[3];b = b / a;c = (b * f[1] + a) / f[2];d = f[(b / c ) % 4];if(f[(a + b + c +
C语言解读方法,一窍不通
#include
int main()
{
int i,a,b,c,d,f[4];
for(i = 0; i < 4; i++)
scanf("%d",&f[i]);
a = f[0] + f[1] + f[2] + f[3];
a = a / f[0];
b = f[0] + f[2] + f[3];
b = b / a;
c = (b * f[1] + a) / f[2];
d = f[(b / c ) % 4];
if(f[(a + b + c + d) % 4] > f[2])
printf("%d\n",a + b);
else
printf("%d\n",c + d);
return 0;
}
输入:9 19 29 39
输出:_______________
C语言解读方法,一窍不通#includeint main(){int i,a,b,c,d,f[4];for(i = 0; i < 4; i++)scanf("%d",&f[i]);a = f[0] + f[1] + f[2] + f[3];a = a / f[0];b = f[0] + f[2] + f[3];b = b / a;c = (b * f[1] + a) / f[2];d = f[(b / c ) % 4];if(f[(a + b + c +
f[0]=9,f[1]=19,f[2]=29,f[3]=39
a=9+19+29+39=96
a=a/f[0]=a/9=10(因为a是Int所以取整)
b=9+29+39=77
b=b/a=77/10=7
c=(7*19+10)/29=4
d=f[(7/4)%4]=f[1%4]=f[1]=19(%就是取余数)
(10+7+4+19)%4=0(40除以4整除,余数为0)
if(f[0]>f[2])=if(9>29)不成立
所以输出c+d =4+19=23