close
標題:

 

此文章來自奇摩知識+如有不便請留言告知

問一個C++很奇怪的問題~

發問:

{ double a,b,c=0.12,d; b=456.12; a=456.0; c=0.12; d=b-a; if(c==d) { cout<<"123"<
最佳解答:

#include #include #include using namespace std; int main() { double a,b,c=0.12,d; b=456.12; a=456.0; d=b-a; cout << fixed; cout<<"a="<
其他解答:

http://www.ziyou.math.ncu.edu.tw/~ziyou/c++/ex/index.htm 這題讓我想到這第9題 2011-10-14 17:44:17 補充: 邏輯與迴圈 第9題 話說這理的習題都超讚= =|||||精度差值 要注意..|||||因為浮點數會有誤差。5C926699F268FE02
arrow
arrow

    yffuhxy 發表在 痞客邦 留言(0) 人氣()