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

正文內(nèi)容

程序設(shè)計(jì)基礎(chǔ)實(shí)驗(yàn)報(bào)告(編輯修改稿)

2024-07-26 15:34 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 nt strcmp(char a[], char b[]){ int i, j。 for (i = 0。 (a[i] != 39。\039。) || (b[i] != 39。\039。)。 i++) { if (a[i]b[i]) { j = 1。 break。 } else if (a[i] = b[i]) j = 0。 else { j = 1。 break。 } } return j。}int main(){ int i, j。 char a[20], b[20]。 cout input tow strings endl。 cin a b。 cout strcmp(a, b) endl。 return 0。}〈4〉 動(dòng)態(tài)鏈表的每個(gè)結(jié)點(diǎn)包括一個(gè)整數(shù)和一個(gè)后繼指針。分別編寫(xiě)過(guò)程完成如下操作: (1) 從鍵盤(pán)輸入數(shù)據(jù)建立鏈表,并按數(shù)據(jù)的輸入順序建立鏈表。(2) 依次打印其中各結(jié)點(diǎn)的數(shù)據(jù)。include includestruct list{int value。struct list *next。}。void main(){int n,i=0,m。struct list *p,*q,*head,*tmp。//第一行輸入數(shù)據(jù)個(gè)數(shù)n; printf(請(qǐng)輸入鏈表的長(zhǎng)度:)。scanf(%d,amp。n)。if(n1)return。//第二行依次輸入n個(gè)整數(shù);printf(請(qǐng)輸入節(jié)點(diǎn)的值:)。p=(struct list*)malloc(sizeof(struct list))。head=p。q=p。qnext=NULL。scanf(%d,amp。pvalue)。for(i=1。in。i++){p=(struct list*)malloc(sizeof(struct list))。scanf(%d,amp。pvalue)。qnext = p。q=p。qnext=NULL。}//第三行輸入欲刪除數(shù)據(jù)m。printf(請(qǐng)輸入要?jiǎng)h除的數(shù)值:)。scanf(%d,amp。m)。//第一行輸出原始單鏈表的長(zhǎng)度;q=head。i=0。while(qnext){i++。q=qnext。}printf(原鏈表長(zhǎng)度為: %d\n,i+1)。//第二行依次輸出原始單鏈表的數(shù)據(jù);printf(鏈表數(shù)據(jù)為:\n)。q=head。while(qnext){printf(%d ,qvalue)。q=qnext。}printf(%d\n,qvalue)。//刪除p=head。while(headvalue == m amp。amp。 headnext != NULL){head=headnext。free(p)。p=head。}if(headvalue == m amp。amp。 headnext == NULL){printf(刪除后的鏈表長(zhǎng)度為 0\n)。printf(刪除后的鏈表為空\(chéng)n)。return。}p=q=tmp=head。while(qnext){q=qnext。while(qvalue==m amp。amp。 qnext !=NULL){tmp=q。q=qnext。free(tmp)。}if(qnext == NULL amp。amp。 qvalue==m){pnext =NULL。}else{pnext =q。}p=q。} //第三行輸出完成刪除后的單鏈表長(zhǎng)度;q=head。i=0。while(qnext){i++。q=qnext。}printf(刪除后的鏈表長(zhǎng)度為 %d\n,i+1)。//第四行依次輸出完成刪除后的單鏈表數(shù)據(jù);printf(刪除后的鏈表為:\n)。q=head。while(qnext){printf(%d ,qvalue)。q=qnext。}printf(%d\n,qvalue)。}實(shí)驗(yàn)六1 在某系的成績(jī)登記冊(cè)中,每個(gè)班最多有40個(gè)學(xué)生,每份成績(jī)表中的成績(jī)信息包括:學(xué)號(hào)(9位字符),姓名(8位字符),成績(jī)(百分制),備注(20位字符)。設(shè)計(jì)程序以處理一個(gè)班級(jí)的成績(jī)信息,包括輸入、輸出、查詢(給定分?jǐn)?shù)以上或以下的學(xué)生信息)、按分?jǐn)?shù)排序等。includestruct student{ int num。 char name[8]。 int gread。 char beizhu[20]。}student[40]。void main(){ int i,j,k,temp。 for(i=0。i40。i++){ cout輸入學(xué)號(hào)。 cinstudent[i].num。 cout輸入姓名。 cinstudent[i].name。 cout輸入成績(jī)。 cinstudent[i].gread。 cout輸入備注。 cinstudent[i].beizhu。 } for(i=0。i40。i++) coutstudent[i].num student[i].name student[i].gread student[i].beizhuendl。 cout輸入分?jǐn)?shù)線。 cinj。 for(i=0。i40。i++){ if(student[i].greadj) coutstudent[i].num student[i].name student[i].gread student[i].beizhuendl。 } for(i=0。i40。i++){ for(k=0。k40。k++){ if(student[k].gread=student[k+1].gread){ temp=student[k].gread。 student[k].gread=student[k+1].gread。 student[k+1].gread=temp。 } } } for(i=0。i40。i++) coutstudent[i].num student[i].name student[i].gread student[i].beizhuendl。}實(shí)驗(yàn)七, minutes和seconds作為數(shù)據(jù)成員的Time類(lèi)。設(shè)計(jì)了成員函數(shù)將兩個(gè)Time對(duì)象相加(即時(shí)間相加),并進(jìn)行相應(yīng)的檢查,查看增加的分鐘數(shù)及秒數(shù)是否大于59。如果秒數(shù)大于59,則分鐘數(shù)向前遞增1。類(lèi)似地,如果分鐘數(shù)大于59,則小時(shí)數(shù)向前增1。include class Time{private: int hours, minutes, seconds。public: void get_time()
點(diǎn)擊復(fù)制文檔內(nèi)容
外語(yǔ)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1