24h購物| | PChome| 登入
2007-10-30 16:50:29| 人氣174| 回應0 | 上一篇 | 下一篇

C

推薦 0 收藏 0 轉貼0 訂閱站台

程式語言期中題庫 (10-29 08:30)
範圍Pages 1~21, Sections 1-1~1-5
===[10%]考單字===
page 6 程式 p___________ 編譯器(編譯程式) c___________ 執行檔an e___________ file
page 6 標準 s____________ 程式庫 l____________ 函數 f___________
page 6 參數 a___________ 變數 v___________
page 7 字串 s___________ 字元 c___________
page 8 反鈄線 b____________
page 8 數學算式a___________ e___________ 格式化輸出 f___________ output
page 9 宣告 d___________ C敍述句(陳述句) C s___________ 註解 c___________
page 10 真 t___________ 假 f___________
page 10 縮排i____________ 分號 s____________
page 10 整數除法 i____________ d____________ 截去小數 t____________ f____________ part
page 11 靠右對齊 right-j____________
page 13 十進位 d___________ 八進位 o___________ 十六進位 h___________
page 13 浮點數 f___________-p___________
page 14 [魔戒三部曲] 初始值設定 i____________ step 迴圈條件判定 loop c___________ evaluation step
page 14 遞增計算 i____________ step 符號常數s____________ c____________
page 15 文字串流 t____________ s___________
page 18 前置式運算元(++x) p____________ operator後置式運算元(--x) p____________ operator
===[25%]考流程 if, while, for 例如:===
int x=0; if (x>=0) { x=x-20; } else { x=x+10; } printf("x=%dn",x); The Answer is: x=_____
int a=100; int cnt=0; while(a!=0) { cnt=cnt+1; a=a/20; } printf("a=%d,cnt=%dn", a, cnt); The Answer is: a=_____, cnt=_____
int a, cnt; for(a=1,cnt=0; a>0; a=a+a) { cnt=cnt+1; } printf("a=%d,cnt=%dn", a, cnt); The Answer is: a=_____, cnt=_____
printf("[%x,%d][%x,%d][%x,%d]", ’A’, ’A’, ’a’, ’a’, ’0’, ’0’); The Answer is:[41,65] ___
printf("%d%d%d%d%d", EOF!=-1, ’A’==’a’, ’9’<48, ’Z’-’A’>26, ’a’-’f’<=’1’-’8’);The Answer is: ___
===[10%]二進位數系===
1Kg(公斤)=103g, 1Km(公里)=103m, 1KBytes=_____Bytes(位元組), 1KBytes=_____Bits(位元), 1Mbps=_____bits per second(每秒位元數),1GHz=_____Hz(頻率)
The 2-digit binary number can be counted as 00, 01, 10, 11 the same as the decimal number 0, 1, 2, 3, respectively. Similarly, the 3-digit binary number can be counted as 000, 001, 010, 011,____, ____,____,111 the same as decimal numbers from 0 to 7
===[20%]填程式===
(1)Write a loop to print out all 3 times multiplication table from "3 x 1 = 3", "3 x 2 = 6", …, to "3 x 9 = 27".
(2)Write a program to print out the GCD (greatest common divisor最大公因數) of two given integers, such as the GCD of 27 and 72 is 9.
(3)Write a program to print out the Fibonacci numbers (費氏級數) 2 3 5 8 13 21 34 55 89.
(4)Write a program to print out the factorial(階乘) 1!=1 2!=2 3!=6 4!=24 … until x! > 4096.
===[40%]寫程式===
(1)Write a for loop to print out all leap years (閏年) from 1960 to 2004. The rules of leap year are that (a) divided by 4 is a leap year; (b) divided by 100 is NOT a leap year; (c) divided by 400 is a leap year. (only +, -, , and / are allowed to use in your answer)
(2)Write a program to print out the exponential numbers 31 32 33 34 … 3x until 3x > 105
(3)Write a program to calculate 1*20+2*21+…+9*28=?
(4)Write a program to calculate (13)/12+(13+23)/22+…+(13+23+…+93)/92=?)

台長: 米豆
人氣(174) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類

是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入圖片中算式的結果(可能為0) 
(有*為必填)
TOP
詳全文