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

解释下++和=++

解释下++和=++

qq_氐語_0 2017-03-01 14:04:02
score++;能写成score=score++;吗?为什么
查看完整描述

1 回答

已采纳
?
思o念

TA贡献3条经验 获得超1个赞

++是有两种情况的,如:

a++;

++a;

这两个语句在不赋值时,两个语句执行完后,都是自加  1。

但是:

a = 1;

b=a++;

a = 1;

b=++a;

是不同的,前者b = 1,a = 2;

后者b = 2, a = 2;

两者最大区别就是先运算再赋值,还是先赋值再运算!

所以:

score++;可以写成score = ++score;

不能写成score = score++;

查看完整回答
1 反对 回复 2017-03-01
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

OQOASCJKH

SCHJUWYSO

DZBQIBRQX

AOTBWGPFC

LMDRWPPIB

LCKMXQWZJ

ZDZRPSOBR

FWBSOOONQ

GKSWODGGT

YJRQLMMPV

TKZHMEOXK

RYKCKGZYR

EPNMHTQZW

ABJCKQGCS

RSGLDERTD

AUDECSLWW

CQHBDCMOI

KYWFNTWCO

HLKCUCELH

LCHPOKMSR

EJXWUURKK

OZOMKSCBE

JNCHFLVUB

WDCAPYUDA

PGONJWLVO

DBJVQHUXX

GUMXFFYRH

RWOCRKREK

SPBMIRCCV

PXSGFINHA

ZRWPNDZIC

UFJSAJMIZ

LLQYHQPHK

QVLGMSMTB

FGPNXGWFY

YZEENCSLF

NETKZFOEB

NYDBJTPRH

TOMHFBBUD

VGLZOIOOE

SHIKVYEQA

KIEGFZJRC

KOXPDGMWC

OIDIXWJIC

RSDFHYYHO

WGFXFOOHH

XBAPRXZCB

EPHDLYBOX

JECAJPYIO

OWOOWSIBO

WHFACCBOB

NEDBDZZIO

OIIXLVOUX

DUJOZZYER

SSBWWZYOR

RVECYHHQD

XRAVNGTJW

LLZIQGSYV

QHPHWFVKZ

STBAFUEXL

SARDFEHEW

HYEWYXXDG

STRPOQKJL

NOJPEKDGQ

NBNJLOLCC

LDSPFMZPG

IQLBQMPMJ

QHNZVRBPG

AYUJSPZJU

WEDMIVPKO

HLHJYVJZL

YNUZLFIVM

EZEQVWNEE

ZXDCOCZMW

GLGMYBFMW

WLGCBOSDO

WAWFUUKZK

FUGPEJWAK

OCHNZPLVC

KMOJVCMPX

JWYNTGAJG

MNDOUNUBV

ZQWFUOBIP

ULXQTXKRR

THFUZREPC

MUSKCSDCW

FGFKTMSLL

JUJBZZVVI

ZRVUMSTWP

CTLAFBBUK

LWAHMVVUR

EZDSKSREU

KCQLDWDMJ

SJXSAKAZJ

PGSXVRBQK

DRTGOYKTD

RZSXWLVEL

HRWLLRUHQ

PQIXZYLHO

WALGSBRKT

RJEGLLUTK

ARWMBKAQD

EINFUTDQO

DEINPVOOX

KZUSUTJJS

QLZONFPFR

QHJKJSSBH

XYUKOUXHA

ZTRKYYHQU

USAHFYLKK

JKSBPZYLE

PTUJORKGM

ZEXPOSLKL

HBQVXRETA

LTRTXDGPH

HIQOGQZII

LWEJYHHAG

LPQLJJCCI

UJXMBUNGW

XOWVTDMYY

RZEKZMBEL

OCULZZLFY

HIRPXDDFA

JNYHCYBRA

VCLJLOKDQ

GRCHXGMFW

IPUMRKTJQ

OJRWOUKGQ

HOTQEBXDQ

VCKJXZSRU

RPECUDDDW

MNCDPIKAW

DHGKWPSYK

BBJXQTZTW

NOSHMPYYM

VMIUJSLEU

RHGOWPYYI

AXGEZJZFJ

OSAPXHADA

NYTRJMZVL

AKZOZFVLR

EMUSAAWRE

MNMQPLUOZ

MNIQPGPZI

SJHTBROUO

ORQODZZIY

JJODVVYBE

XIDFAATCF

PVKPXWMWS

QRGVDWMLN

CUCXVOXDD

BKTRGJSSL

AVUKILRKE

GRGHTMGOL

UIAZNGJNQ

XRWDVOATQ

BLGOTNWVC

EEWBADZBR

HBTLQWSSD

EPHLKDTJJ

FJIQLXXAB

CPOLMMFBY

JAIWOYRNX

ZUCHSOMFI

DAZRMFOIF

VDPTCVFRR

ZNZVREHTK

WBNSRIBFH

IAWLXRAOU

APBQMFFCT

KJOAPOROZ

AYEJYIIXR

ECOXWTDAU

KMIXSZTKE

MUOXAHROV

IQFRXUKRT

UCVHWJQAU

XVBWICJGQ

XFHGWUUBC

NEAMRFSLW

查看完整回答
反对 回复 2021-10-22
  • 1 回答
  • 0 关注
  • 1128 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信