C語言第4章習(xí)題解答.pdf_第1頁
C語言第4章習(xí)題解答.pdf_第2頁
C語言第4章習(xí)題解答.pdf_第3頁
C語言第4章習(xí)題解答.pdf_第4頁
C語言第4章習(xí)題解答.pdf_第5頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

第第 4 章習(xí)題參考答案章習(xí)題參考答案 1 單項(xiàng)選擇題 單項(xiàng)選擇題 1 D 2 D 3 D 4 B 5 D 6 B 7 A 8 D 9 C 10 D 11 B 12 D 13 A 14 B 2 填空題 填空題 1 2 2 嵌套 遞歸 3 全局變量 局部變量 靜態(tài)變量 動(dòng)態(tài)變量 4 auto static register extern 5 外部變量 6 編譯 運(yùn)行 3 閱讀程序 指出結(jié)果 閱讀程序 指出結(jié)果 1 15 2 5 3 5 4 3 4 i 5 i 2 i 2 i 4 i 2 5 求水仙花數(shù) 6 5 5 5 7 30 8 0 10 1 11 2 12 4 程序填空 程序填空 1 float fun float float x y x y z y z y 2 x x x 1 3 s 0 a a b 5 編程題 編程題 1 include unsigned int fun unsigned int int main unsigned int s scanf u printf u n fun s return 0 unsigned int fun unsigned int s unsigned int p 0 while s 0 p p s 10 s s 10 return p 2 include include include void f1 float float float float void f2 float float float float void f3 float float float float int main float a b c d scanf f f f if a 0 printf 不是一元二次方程 n exit 0 d b b 4 a c if d 0 f1 a b c d else if d 0 f2 a b c d else f3 a b c d return 0 void f1 float a float b float c float d float x1 x2 x1 b sqrt d 2 a x2 b sqrt d 2 a printf 2f 2f n x1 x2 void f2 float a float b float c float d float x1 x2 x1 b 2 a x2 b 2 a printf 2f 2f n x1 x2 void f3 float a float b float c float d float x1 x2 x1 b 2 a x2 sqrt d 2 a printf 2f i 2f n x1 x2 printf 2f i 2f n x1 x2 3 include double p int double int main int n double x do scanf d while n 0 scanf lf printf lf n p n x return 0 double p int n double x double pn if n 0 pn 1 else if n 1 pn x else pn 2 n 1 x p n 1 x n 1 p n 2 x n return pn 4 include define RATE 0 053 double fun float void display float int int main float dep int season scanf f d display dep season return 0 double fun float d return d RATE void display float d int s int i printf 季度 利息 余額 n printf n for i 1 i s i printf 4d 2f 2f n i fun d fun d i d printf n 5 include double fun void int main printf lf n fun return 0 double fun void double s 0 int n 1 while double 2 n 1 2 n 2 n 1e 4 s s double 2 n 1 2 n 2 n n return s 6 include int fun int int main int w scanf

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論