function fn1xyreturn ++x + y++fn145
The output would be 10.
Explanation:
- In the expression
++x, the variablexis incremented first and then used in the addition. So,xbecomes 5 and the result of this expression is 5. - In the expression
y++, the variableyis used in the addition first and then incremented. So,yremains 5 and the result of this expression is also 5. - Adding the results of the two expressions, we get 5 + 5 = 10.
原文地址: https://www.cveoy.top/t/topic/bfQW 著作权归作者所有。请勿转载和采集!