freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

電大c語言程序設(shè)計第1、2、3、4次作業(yè)及答案參考小抄(編輯修改稿)

2025-07-09 02:51 本頁面
 

【文章內(nèi)容簡介】 n。 for(i = 0。 i n。 i ++) if(a[i] = s) m ++。 return m。 } 16 參考答案: 一、 答案: 運行結(jié)果: GG PP BB WW 答案: 運行結(jié)果: 答案: 運行結(jié)果: main: x, y = 18, 23 subs: x, y = 41, 64 main: x, y = 36, 23 答案: 運行結(jié)果: 432198765 運行結(jié)果: 47 36 32 28 20 15 答案: 運行結(jié)果: 3 5 7 9 11 13 15 17 答案: 運行結(jié)果: 50 60 答案: 運行結(jié)果: b=184 二、 答案: 在整型數(shù)組 a 的前 n 個元素中查找值為 x 的元素,找到返回 1,找不到返回 0。 答案: 統(tǒng)計整型數(shù)組 a的前 n 個元素中不小于 k 的元素個數(shù)并返回 答案: 程序隨機產(chǎn)生 10道 20以內(nèi)整數(shù)加法題,請用戶回答。并統(tǒng)計得分, 答案: 調(diào)用 fun6(m, n, 2)求 m 和 n 的最小公倍數(shù) 答案 :讀入 n個整數(shù),然后逆序輸出 17 答案 :返回雙精度數(shù)數(shù)組 a 的前 n個元素中不小于平均值的元素個數(shù) 。 第四次作業(yè) 一、 寫出下列每個程序運行后的輸出結(jié)果 1. 程序代碼: include struct Worker { char name[15]。 // 姓名 int age。 // 年齡 float pay。 // 工資 }。 void main() { struct Worker x = { wanghua, 52, 2350 }。 struct Worker y, * p。 y = x。 p = amp。x。 printf(%s %d %\n, , , )。 printf(%s %d %\n, pname, page + 1, ppay + 20)。 } 2. 程序代碼: include include struct Worker { char name[15]。 // 姓名 int age。 // 年齡 float pay。 // 工資 }。 void main() { struct Worker x。 char * t = liouting。 18 int d = 38。 float f = 493。 strcpy(, t)。 = d。 = f。 ++。 *= 2。 printf(%s %d %\n, , , )。 } 3. 程序代碼: include struct Worker { char name[15]。 // 姓名 int age。 // 年齡 float pay。 // 工資 }。 int Less(struct Worker r1, struct Worker r2) { if( ) return 1。 else return 0。 } void main() { struct Worker a[4] = { { abc, 25, 420 }, { def, 58, 638 }, { ghi, 49, 560 }, { jkl, 36, 375 } }。 struct Worker x = a[0]。 int i。 for(i = 1。 i 4。 i ++) if(Less(x, a[i])) x = a[i]。 printf(%s %d %\n, , , )。 } 二、 寫出下列每個函數(shù)的功能 1. 程序代碼: struct Worker { 19 char name[15]。 // 姓名 int age。 // 年齡 float pay。 // 工資 }。 void QA(struct Worker a[], int n) { int i。 for(i = 1。 i n。 i ++) scanf(%s %d %f, amp。a[i].name, amp。a[i].age, amp。a[i].pay)。 } 2. 程序代碼: struct StrNode { char name[15]。 // 字符串域 struct StrNode * next。 // 指針域 }。 struct StrNode * QB(int n) { struct StrNode * f, * p。 if(n == 0) return NULL。 f = malloc(sizeof(struct StrNode))。 scanf(%s, fname)。 p = f。 while( n) { p = pnext = malloc(sizeof(struct StrNode))。 scanf(%s, pname)。 } pnext = NULL。 return f。 } 3. 程序代碼: struct IntNode { 20 int data。 // 結(jié)點值域 struct IntNode * next。 // 結(jié)點指針域 }。 struct IntNode * FindMax(struct IntNode * f) { struct IntNode * p = f。 if(! f) return NULL。 f = fnext。 while(f) { if(fdata pdata) p = f。 f = fnext。 } return p。 } 4. * 程序代碼: struct IntNode { int data。 // 結(jié)點值域 struct IntNode * next。 // 結(jié)點指針域 }。 int Count(struct IntNode * f) { int c = 0。 while(f) { c ++。 f = fnext。 } return c。 } 21 5. 程序代碼: struct IntNode { int data。 // 結(jié)點值域 struct IntNode * next。 // 結(jié)點指針域 }。 struct IntNode * Input(int n) { struct IntNode * f, * p。 f = malloc(sizeof(struct IntNode))。 if(n == 0) return NULL。 fnext = NULL。 printf(從鍵盤輸入 %d 個整數(shù): , n)。 while(n ) { scanf(%d, amp。(fdata))。 p = f。 f = malloc(sizeof(struct IntNode))。 fnext = p。 } return fnext。 } 6. 程序代碼: include include include void JA(char * fname) { FILE * fout = fopen(fname, w)。 char a[20]。 printf(輸入若干個字符串,每個字符串長度小于 20,字符串 end 作為結(jié)束標志 \n)。 while(1) { scanf(%s, a)。 22 if(strcmp(a, end) == 0) break。 fputs(a, fout)。 fputc(39。\n39。, fout)。 } fclose(fout)。 } void main() { char * p = d:\\xxk\\。 JA(p)。 } 參考答案: 23 一、 答案: 運行結(jié)果: wanghua 52
點擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1