Re: [考題] 計算機概要-程式問題

看板 Examination
作者 meya (落寞之心)
時間 2012-12-11 17:53:35
留言 4則留言 (1推 0噓 3→)

: 1. : #include<stdio.h> : int main() : { int a=2,b=5; : a+=a++*--b; : printf("%d\n",a); : } : (A)9 (B)10 (C)11 (D)13 : 答案:(C) : 但是我算出來答案是B, : 2+(2*4)=10,不知道是哪個地方錯誤!! 是在printf()這個函式內計算錯誤 a= a+ a++* --b ; t5 t3 t1 t2 t4... 時間點 t1時a=2,t2時a=2,t3時a=2,t4時a=2,t5時a=2+2*4=10 printf("%d\n",a); t6 t6時a=11 -- ◆ From: 220.136.166.143
※ 批踢踢實業坊(ptt.cc)
※ 文章網址: https://www.ptt.cc/bbs/Examination/M.1355219618.A.F5E.html

orientorient:不是已經解過了... 還回文是?? 12/11 18:28

asdd:這樣寫不是更容易"了解"問題所在嗎!! 12/11 22:01

orientorient:要這樣寫才了解喔... 12/12 07:26

orientorient: 更 12/12 07:26

您可能感興趣