題組內容
四、
⑴程式 A 列印出的結果是什麼?說明理由。(10 分)
詳解 (共 3 筆)
詳解
x=5.6
int y =(int)(x+0.5)
先加起來後在強制轉行5.6+0.5=6.1>>>y=6
印出6
詳解
x+0.5=6.1
(int)強制轉型為整數6
詳解
Result = 6