一道很简单很基础的C++作业题

来源:百度知道 编辑:UC知道 时间:2024/06/14 09:26:31
what is the result of each of the following expressions?
a. 27 + 8 / 5 - 7
b. 27.0 + 8.0 / 5.0 - 7.0
c. 25 % 7 + 9.0
d. 17++
e. int(15.0 + 12.0 *2.2 - 3 * 7)
f. 23--
g. 18 / 1.0

a. 27 + 8 / 5 - 7 = 27 + 1 - 7 = 21
b. 27.0 + 8.0 / 5.0 - 7.0 = 27.0 + 1.6 - 7.0 = 21.6
c. 25 % 7 + 9.0 = 4 + 9.0 = 13.0
d. 17++ = 18
e. int(15.0 + 12.0 *2.2 - 3 * 7) = int(20.4) = 20
f. 23--
g. 18 / 1.0 = 18.0

d
f

21
21.6
13
18
20
22
18
你可以自己去调试下,我刚看了下,都没错

一楼回答的就是答案了