close
Blogtrottr
批踢踢實業坊 Examination 板
 
Compare Hotels

Find great prices for amazing hotels wherever your next destination may be. It's simple to search 100+ sites at once!
From our sponsors
[考題] 程式語言-101鐵路
Apr 24th 2014, 11:19, by TomTung

作者TomTung (Tom)

看板Examination

標題[考題] 程式語言-101鐵路

時間Thu Apr 24 11:19:06 2014

下列 C 語言片斷執行後,何者正確。 int A[3] = {0,0,0}; int x=2; A[x]= x--; 選項: (A) A[1] = 1 (B) A[1] = 2 (C) A[2] = 1 (D) A[2] = 2 解答是(D) 我的想法如下: A[x]= x--; //此行先執行x--,所以x的值2給A[x]。 =右側x的值仍然為2, =左側A[x]的x值已更改為1,因為x--為後置減法。 所以A[x] = x-- 應為: A[1] = 2 麻煩懂此題觀念的人指導我。 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.25.53.250 ※ 文章網址: http://www.ptt.cc/bbs/Examination/M.1398309548.A.B05.html

qaz5620:A[x]=x-- 會先執行 A[x]=x 在x-- 所以為A[2]=2 04/24 11:22

n873192000:誠如樓上所講解 04/24 11:28

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 yisoajkls 的頭像
    yisoajkls

    2016徵求年菜推薦網路訂購最紅的商家.年菜訂購?台北年菜外送餐廳推薦(年菜)?年菜.今年不想做年菜推薦,網路宅配哪一家好?

    yisoajkls 發表在 痞客邦 留言(0) 人氣()