m=10m++ - --m + ++m - m-- + m++ - m-- + m++
Let's break down the expression step by step:
-
m++ - The value of m is initially 10, and then it is incremented by 1. So, m++ returns 10, and m becomes 11.
-
--m - The value of m is decremented by 1. So, --m returns 10, and m becomes 10.
-
++m - The value of m is incremented by 1. So, ++m returns 11, and m becomes 11.
-
m-- - The value of m is initially 11, and then it is decremented by 1. So, m-- returns 11, and m becomes 10.
-
m-- - The value of m is initially 10, and then it is decremented by 1. So, m-- returns 10, and m becomes 9.
-
m++ - The value of m is incremented by 1. So, m++ returns 9, and m becomes 10.
-
m-- - The value of m is initially 10, and then it is decremented by 1. So, m-- returns 10, and m becomes 9.
-
m++ - The value of m is incremented by 1. So, m++ returns 9, and m becomes 10.
In summary, the expression m++ - --m + ++m - m-- + m++ - m-- + m++ is equal to 10 - 10 + 11 - 10 + 9 - 9 + 10, which simplifies to 11
原文地址: http://www.cveoy.top/t/topic/hZCQ 著作权归作者所有。请勿转载和采集!