这是标准的国内学院派出的题,一帮混蛋加废物。
如果你老师出这种题,那你碰到了一个很差的老师。如果哪本书上出这种题,这本书你可以扔掉了。
[此贴子已经被静夜思于2004-05-08 09:50:55编辑过]
从右向左
楼上说的很对
[此贴子已经被静夜思于2004-05-08 09:51:08编辑过]
对,我认为关于这些结合性的问题,不用都知道的非常的清楚!
因为你如果把语句写成这样,即使你自己清楚也会犯糊涂的,除非你想让你的代码别人看不懂!
一些东西只要自己做着觉得顺心就可以了,不用总难为自己!!!!
多谢各位,虽然在下不明白是怎样解的。但还是要谢了
偶不这么认为,有时候基础的东西很重要,同一个问题用不同的算式决定不同的速度,也关系到代码的精练与否。 偶也是新手,我试着解释一下,不对的话大家不要笑话。
n=n+(n-(n*n)),大概就是这样滴吧
分为三句
n=n*n;
n=n-n;
n=n+n;
it is wrong,
---------------------------------------------------------------------------
Don't get carried away and increment or decrement the same value more than once in the same statement. The problem is that the use-then-change and change-then-use rules can become ambiguous. That is, a statement such as
x = 2 * x++ *(3 - ++x); // don't do it
can produce quite different results on different systems. C++ does not define correct behavior for this sort of statement.