大家快来看看,这个程序很诡异。
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
float a=10.23;
int b;
a=a*100;
b=a;
cout<<b;
return 0;
}
各位大侠
这个程序输出的b为1022,为什么啊?
在下先谢过各位了!
2011-11-06 22:26
2011-11-06 23:43
学习中
2011-11-07 12:38
2011-11-07 12:47
2011-11-08 08:34
学习了
2011-11-08 09:21
这样的误差问题能改一下程序,使之避免吗?
2011-11-08 20:34
2011-11-09 09:34