有表达式如下:
int i = (1 / 4) * 8;
请问 i 是多少?2,这还用怀疑吗?
事实上,计算机给出的结果是0。
要这样写才是2:
int i = (1 * 8) / 4;
posted on 2011-09-27 12:09 左直拳 阅读(177) 评论(0) 收藏 举报