作者ric2k1 (Ric)
看板EE_DSnP
標題Re: [問題] 有第一次作業的標準解答嗎?
時間Sat Oct 6 12:44:09 2007
:
: 已上傳至課程網頁 ---
:
: http://cc.ee.ntu.edu.tw/~ric/teaching/ComputerProgramming/latest/Homework%20assignments.htm
:
: 助教是誰還不知道, 只好自己寫... 有問題請多指教.
:
: --
:
※ 發信站: 批踢踢實業坊(ptt.cc)
: ◆ From: 59.121.130.193
: → ric2k1:感謝不能三日不見的高手提醒, 偷偷更新第三題的答案... 10/05 00:22
: 推 ilway25:我發現int a,,b;不對但int a,b,;對耶..上網找不到答案- - 10/05 00:56
: 推 ric2k1:的確, 不過這個太不正常了, 可以看看就好. 謝謝指正. 10/05 08:26
: 推 keyboardle:我在改作業時..發現{}加在main之前的綠色區都有error.. 10/06 11:50
: 推 ric2k1:哎呀, 寫的太急了, 在main之前的綠色區域都不能加 {} 10/06 12:37
很抱歉, 第四題的答案在匆忙中寫錯了----
在main之前的綠色區域都不能加 {}, 只能加 ';'
不過目前 cc.ee.ntu.edu.tw 好像掛了, 等一下再將新版的解答上傳.
=========
Just FYI. The orange region is the original green region before main()
=========
Adding a ';' is like a adding an empty (null) statement. So it can be
inserted at where a statement can be added.
Adding a "{}" is like declaring a scope. So it can be inserted at where
creating new scope makes sense.
So you can insert a ';' or "{}" in the "green" places, but will get a warning
in the "yellow" spot. You can insert a ';' in the orange area, but you cannot
insert a "{}" there. Compiler will issue an error if you insert them
somewhere else.
You may insert a ',' or "()" after <iostream> ("yellow region"), but you will
get a compilation warning. ',' cannot be inserted anywhere else.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.121.130.193
1F:→ ric2k1:已重新上傳 10/06 13:08