一个程序,不知为什么数值会变??
#include "stdio.h" main() { double x; int a=1,b=1,c=1,d=1; x=97.6875; printf("x=%f\n",x); printf("x=%d\na=%d\nb=%d\nc=%d\nd=%d\n"); }
想问一下为什么abcd的数值会变,谢谢。


#include "stdio.h" main() { double x; int a=1,b=1,c=1,d=1; x=97.6875; printf("x=%f\n",x); printf("x=%d\na=%d\nb=%d\nc=%d\nd=%d\n"); }
想问一下为什么abcd的数值会变,谢谢。


2004-07-21 18:48

2004-07-21 19:05
2004-07-21 19:21
2004-07-21 20:32
2004-07-21 21:20
不好意思,上面的程序是我打漏了。但是我打的就是2搂修改的程序啊。
#include "stdio.h" main() { double x; int a=1,b=1,c=1,d=1; x=97.6875; printf("x=%f\n",x); printf("x=%d\na=%d\nb=%d\nc=%d\nd=%d\n",x,a,b,c,d); }
这个程序也有问题啊。请试试在TurboC中运行。

2004-07-21 23:23
小弟试过,无论是printf("x=%d\na=%d\nb=%d\nc=%d\nd=%d\n",x,a,b,c,d);
还是printf("x=%d\na=%d\nb=%d\nc=%d\nd=%d\n");
都是一样的结果。
x=97.687500 x=0 a=0 b=27648 c=16472 d=1
这就是两次的结果。大哥们只需复制两次的帖子上的程序就行了。

2004-07-22 00:33
2004-07-22 12:46
2004-07-22 13:23
2004-07-22 13:35