printf("%d",3>2?1:1.5); 输出结果为什么是0而不是1呢?
printf("%d",3>2?1:1.5); 输出结果为什么是0而不是1呢?为什么对条件表达式的值的数据类型不能改变呢?
如:
int m=3>2?1:1.5;
printf("%f,%d",3?2?1:1.5,3>2?1:1.5);
运行结果:1.000000,0
以浮点型格式输出结果是1.000000正确,而已整型的格式输出结果不是1而是0呢?
2008-03-12 17:33
2008-03-12 17:50
2008-03-12 18:23
2008-03-12 18:31
2008-03-12 18:38
2008-03-12 19:09

2008-03-12 19:25

2008-03-12 19:29
2008-03-12 19:29
2008-03-12 19:31