close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
這5題..A++....誰會.........
Oct 12th 2014, 11:01

知識問題|

發問者: 丫丫 ( 初學者 5 級)
發問時間: 2014-10-12 19:01:25 ( 還有 4 天發問到期 )
解答贈點: 5 ( 共有 0 人贊助 )
回答: 0 0

1.試著逐行瞭解下面的程式碼,並在每一行敘述後面加上註解,然後編譯並執行它。
01 // hw2_1, C++程式的練習
02 #include
03 #include
04 using namespace std;
05 int main(void)
06 {
07 int num;
08 num=6;
09 cout 10 cout 11 system("pause");
12 return 0;
13 }
2.試寫一程式列印字串內容 "There is no rose without a thorn."。撰寫程式的同時,也請您為每一行敘述加上註解。
3.請試著練習將n1、n2宣告成整數型態變數,宣告完成後,再將n1設值為6,n2設值為8,最後再將n1、n2的值及n1+n2的值印出。請為每一行敘述加上註解。
4.試找出下列程式何處有誤,並加以改正。
01 // hw2_13, 請找出此程式何處有誤
02 #include
03 #include
04 int main(void)
05 {
06 int num=2
07 cout 08 }
09 system("pause");
10 return 0;
11 }
5.下面的程式碼是一個簡單的C++程式,其程式的編排方式並不易於閱讀。請重新編排它來提高程式的可讀性:
01 // hw2_15, 沒有編排的程式
02 #include
03 #include
04 using namespace std;int main(void){int a,b;a=8;b=10;
05 cout 06 system("pause");return 0;}

目前沒有資料

目前沒有資料

馬上按讚  加入 Yahoo! 奇摩 知識+  粉絲團

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
    全站熱搜
    創作者介紹
    創作者 mkmkmklal 的頭像
    mkmkmklal

    線上遊戲排行榜2013/2014,進擊的巨人線上看,candy crush saga外掛,正妹寫真三圍

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