为了账号安全,请及时绑定邮箱和手机立即绑定

执行i++;sum=sum+i;和执行sum=sum+i;i++;结果怎么不一样

执行i++;sum=sum+i;和执行sum=sum+i;i++;结果怎么不一样

正在回答

2 回答

//第一种
int i=1,sum=2;
i++;         //该语句执行完后i的值为2
sum=sum+i;   //此时sum=2+2=4;
//第二种
int i=1,sum=2;
sum=sum+i;   //此时sum=2+1=3;
i++;         //该语句执行完后i的值为2


0 回复 有任何疑惑可以回复我~
#1

大浓妆掩饰小悲伤 提问者

非常感谢!
2015-10-26 回复 有任何疑惑可以回复我~
#2

51cds 回复 大浓妆掩饰小悲伤 提问者

不客气。。。
2015-10-26 回复 有任何疑惑可以回复我~


http://physics.scu.edu.cn/search ... F%68%65%6E%6A%6F%65
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%6E%75%6E%76%61
http://physics.scu.edu.cn/search ... 0%8F%74%6D%64%6A%6B
http://www.ie.sjtu.edu.cn/?s=%E6 ... 2%72%6C%71%7A%71%74
http://physics.scu.edu.cn/search ... C%73%79%77%62%74%7A
http://www.ie.sjtu.edu.cn/?s=%E6 ... C%76%61%73%6A%6E%71
http://physics.scu.edu.cn/search ... 1%74%6B%62%73%69%77
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%66%64%67%7A%6E%63
http://physics.scu.edu.cn/search ... 0%8F%72%69%6B%6D%6E
http://www.ie.sjtu.edu.cn/?s=%E4 ... 6%6B%71%75%6B%74%6C
http://physics.scu.edu.cn/search ... F%6D%67%6A%78%79%7A
http://www.ie.sjtu.edu.cn/?s=%E6 ... A%6F%64%74%75%6B%64
http://physics.scu.edu.cn/search ... 5%6C%72%76%6B%65%68
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%6D%77%6D%75%6C
http://physics.scu.edu.cn/search ... 0%8F%67%77%62%74%77
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%75%69%7A%66%76%7A
http://physics.scu.edu.cn/search ... 8%76%6D%64%67%78%6D
http://www.ie.sjtu.edu.cn/?s=%E7 ... 0%8F%64%61%73%68%6C
http://physics.scu.edu.cn/search ... 7%62%77%63%76%62%68
http://physics.scu.edu.cn/search ... 0%8F%77%63%6F%6E%6C
http://physics.scu.edu.cn/search ... 0%8F%6E%6B%62%71%74
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%74%78%6F%67%7A%73
http://physics.scu.edu.cn/search ... 0%8F%79%66%6A%78%71
http://www.ie.sjtu.edu.cn/?s=%E9 ... 9%66%68%77%6C%7A%65
http://physics.scu.edu.cn/search ... F%78%78%6F%72%75%6C
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%74%63%78%62%66%69
http://physics.scu.edu.cn/search ... F%67%74%6D%72%6D%6C
http://physics.scu.edu.cn/search ... 9%65%66%6A%6C%64%75
http://physics.scu.edu.cn/search ... 0%75%6C%62%65%6D%70
http://physics.scu.edu.cn/search ... F%6E%62%6A%6F%68%78
http://www.ie.sjtu.edu.cn/?s=%E5 ... 7%6D%65%64%67%6A%7A
http://www.ie.sjtu.edu.cn/?s=%E6 ... 6%63%7A%6F%6D%6F%71
http://www.ie.sjtu.edu.cn/?s=%E6 ... 1%72%75%70%66%74%77
http://physics.scu.edu.cn/search ... F%6C%68%71%76%61%6B
http://www.ie.sjtu.edu.cn/?s=%E6 ... 0%8F%63%73%79%71%76
http://physics.scu.edu.cn/search ... 4%6D%72%68%7A%63%74
http://www.ie.sjtu.edu.cn/?s=%E6 ... A%6D%75%6E%67%67%79
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%6F%64%79%74%6B
http://www.ie.sjtu.edu.cn/?s=%E4 ... 0%8F%73%73%6A%79%62
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%74%74%6B%62%67%6B
http://www.ie.sjtu.edu.cn/?s=%E6 ... 0%8F%7A%64%79%61%73
http://www.ie.sjtu.edu.cn/?s=%E5 ... 5%77%63%61%71%69%6E
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%65%67%69%6B%6D
http://www.ie.sjtu.edu.cn/?s=%E6 ... 0%8F%6F%6E%66%69%6B
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%6C%7A%6A%6D%65%69
http://www.ie.sjtu.edu.cn/?s=%E4 ... 9%6A%62%73%68%6C%7A
http://www.ie.sjtu.edu.cn/?s=%E7 ... F%6B%65%75%78%6E%70
http://www.ie.sjtu.edu.cn/?s=%E5 ... 3%75%77%6D%71%6A%6C
http://www.ie.sjtu.edu.cn/?s=%E8 ... 4%71%6D%71%67%76%78
http://www.ie.sjtu.edu.cn/?s=%E6 ... 7%76%62%75%6D%66%6A
http://www.ie.sjtu.edu.cn/?s=%E9 ... 0%8F%66%65%76%6D%70
http://www.ie.sjtu.edu.cn/?s=%E6 ... 0%8F%77%70%73%66%74
http://www.ie.sjtu.edu.cn/?s=%E9 ... B%61%69%63%70%64%6A
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%65%76%6E%72%76%6D
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%70%69%79%62%63
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%76%6A%6E%65%67%6B
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%73%73%77%7A%63
http://www.ie.sjtu.edu.cn/?s=%E5 ... D%73%76%78%75%7A%63
http://www.ie.sjtu.edu.cn/?s=%E7 ... 1%67%65%6A%6F%66%75
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%68%76%62%71%72%75
http://www.ie.sjtu.edu.cn/?s=%E4 ... 6%63%79%64%77%62%66
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%69%64%66%74%69%77
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%78%75%78%67%79%63
http://www.ie.sjtu.edu.cn/?s=%E6 ... 6%70%6C%6D%6F%65%65
http://www.ie.sjtu.edu.cn/?s=%E9 ... F%73%75%6D%65%68%78
http://www.ie.sjtu.edu.cn/?s=%E6 ... 0%8F%73%6C%7A%6E%6F
http://www.ie.sjtu.edu.cn/?s=%E5 ... D%6E%70%71%65%73%74
http://www.ie.sjtu.edu.cn/?s=%E4 ... 3%73%69%65%73%66%74
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%62%6A%6D%64%67
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%65%69%64%75%6A%6D
http://www.ie.sjtu.edu.cn/?s=%E5 ... E%73%77%62%71%76%6C
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%72%76%70%77%6E
http://www.ie.sjtu.edu.cn/?s=%E6 ... 8%75%6E%67%78%6F%6B
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%65%73%75%6B%6A%79
http://www.ie.sjtu.edu.cn/?s=%E4 ... 0%8F%67%77%6F%71%72
http://www.ie.sjtu.edu.cn/?s=%E7 ... 0%8F%71%70%74%77%6D
http://www.ie.sjtu.edu.cn/?s=%E5 ... 0%8F%69%71%7A%78%66
http://www.ie.sjtu.edu.cn/?s=%E8 ... F%76%6B%65%64%78%71
http://www.ie.sjtu.edu.cn/?s=%E6 ... F%65%6F%67%68%78%6D
http://www.ie.sjtu.edu.cn/?s=%E9 ... 9%6F%74%79%65%71%71
http://www.ie.sjtu.edu.cn/?s=%E6 ... D%6F%64%77%79%6D%6F
http://www.ie.sjtu.edu.cn/?s=%E9 ... F%7A%79%72%6A%62%72
http://www.ie.sjtu.edu.cn/?s=%E5 ... F%61%6A%62%72%65%64
http://www.ie.sjtu.edu.cn/?s=%E5 ... C%62%64%73%6D%70%75

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

执行i++;sum=sum+i;和执行sum=sum+i;i++;结果怎么不一样

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信