forÑ­»·ÖÐi++Óë++iµÄÇø±ð

»Ø´ð
°®Ñï½ÌÓý

2022-06-10

  • Ïà¹ØÍƼö
1¡¢ÒýÓÃ˳Ðò²»Í¬¡£
Ç°ÕßÊÇ£ºÏÈÒýÓ㬺óÔö¼Ó£¬£¬ºóÕßÊÇ£ºÏÈÔö¼Ó£¬ºóÒýÓã¬++iÊÇÏȸıäiµÄÖµ£¬¶øi++ÊÇÏÈʹÓÃiֵȻºóÔٸıäËüµÄÖµ¡£
ÀýÈ磺iµÄÔ­ÖµÊÇ5£¬Ôò¶ÔÓÚj=++i£¬jµÄֵΪ6£»¶ÔÓÚj=i++£¬jµÄֵΪ5£¬È»ºójµÄÖµ±äΪ6¡£
2¡¢Êä³ö½á¹û²»Í¬¡£
ËüÃÇÁ½¸ö±í´ïÐÎʽ²»Í¬£¬ÆäÊä³ö½á¹ûÒ²ÊDz»Ò»ÑùµÄ£¬i++Êä³ö½á¹ûÊÇ1£¬¶ø++iÊä³ö½á¹ûÊÇ2

À©Õ¹×ÊÁÏ


"++"ÊÇCºÍC++ÀïµÄ×ÔÔöÔËËã·û¡£ÆäÖУº++iÊÇʹÓÃi֮ǰÏÈʹi¼ÓÒ»¡£i++ÊÇʹÓÃiÖ®ºóÔÙ¼ÓÒ»¡£Èç¹û²»ÄÜÀí½â,ÄÇô¿ÉÒÔÀí½âΪ£º++iÊÇÏȼÆË㣬ÔÙ²Ù×÷£¬i++ÊÇÏȲÙ×÷£¬ÔÙ¼ÆËã¡£ÆäÖУº++iºÍi++ÊÇË­ÔÚÇ°ÏÈÈ¡Ë­£¬µ«¼ÓÒ»ÓÅÏÈÔËËã²¢¸³¸øÔ­Öµ£¬È¡µÄÖµÔÙ²ÎÓëÆäËûÔËËã¡£
++i ºÍ i++µÄ½á¹ûÊÇÒ»ÑùµÄ£¬¶¼ÒªµÈ´úÂë¿éÖ´ÐÐÍê±Ï²ÅÄÜÖ´ÐÐÓï¾ä£¬µ«ÊÇÐÔÄÜÊDz»Í¬µÄ¡£ÔÚ´óÁ¿Êý¾ÝµÄʱºò++iµÄÐÔÄÜÒª±Èi++µÄÐÔÄܺÃÔ­Òò£ºi++ÓÉÓÚÊÇÔÚʹÓõ±Ç°ÖµÖ®ºóÔÙ+1£¬ËùÒÔÐèÒªÒ»¸öÁÙʱµÄ±äÁ¿À´×ª´æ¡£¶ø++iÔòÊÇÔÚÖ±½Ó+1£¬Ê¡È¥Á˶ÔÄÚ´æµÄ²Ù×÷µÄ»·½Ú£¬Ïà¶Ô¶øÑÔÄܹ»Ìá¸ßÐÔÄÜ¡£