- 971 名前:デフォルトの名無しさん mailto:sage [2008/02/04(月) 17:34:53 ]
- 猫でもわかるC言語プログラミングという本で勉強し始めたのだが、
誤字脱字ありすぎで正直自分が悪いのか本が間違ってるのかコンパイラの問題なのかわからん。 Borland C++ Compiler 5.5 #include <stdio.h> #include <float.h> int main() { double pai = 3.14159265358979; int mon = 2; printf("%d\n", mon = 3); printf("%e\n", pai); printf("%05d\n", mon); printf("%20.18f\n", pai); return 0; } で 3 3.141593e+000 00003 3.141592653589790000 と表示されるらしいのだが、 @二行目が 3.141593e+00 、四行目が 3.141592653589790007 になる。 Aコンパイラが警告を出す。('mon'に代入した値は使われていない) どうしたらいいのか教えてください。
|

|