算法有问题吧?
#include <stdio.h>
int main()
{
int a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = a /b *c+ d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
1/2*3+4=5.5
不该等于5吗?怎么运算结果是4呢?
#include <stdio.h>
int main()
{
int a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = a /b *c+ d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
1/2*3+4=5.5
不该等于5吗?怎么运算结果是4呢?
2018-08-08
举报