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

正文內(nèi)容

程序設(shè)計基礎(chǔ)實驗報告(編輯修改稿)

2025-07-26 15:34 本頁面
 

【文章內(nèi)容簡介】 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〉 動態(tài)鏈表的每個結(jié)點包括一個整數(shù)和一個后繼指針。分別編寫過程完成如下操作: (1) 從鍵盤輸入數(shù)據(jù)建立鏈表,并按數(shù)據(jù)的輸入順序建立鏈表。(2) 依次打印其中各結(jié)點的數(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ù)個數(shù)n; printf(請輸入鏈表的長度:)。scanf(%d,amp。n)。if(n1)return。//第二行依次輸入n個整數(shù);printf(請輸入節(jié)點的值:)。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(請輸入要刪除的數(shù)值:)。scanf(%d,amp。m)。//第一行輸出原始單鏈表的長度;q=head。i=0。while(qnext){i++。q=qnext。}printf(原鏈表長度為: %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(刪除后的鏈表長度為 0\n)。printf(刪除后的鏈表為空\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。} //第三行輸出完成刪除后的單鏈表長度;q=head。i=0。while(qnext){i++。q=qnext。}printf(刪除后的鏈表長度為 %d\n,i+1)。//第四行依次輸出完成刪除后的單鏈表數(shù)據(jù);printf(刪除后的鏈表為:\n)。q=head。while(qnext){printf(%d ,qvalue)。q=qnext。}printf(%d\n,qvalue)。}實驗六1 在某系的成績登記冊中,每個班最多有40個學(xué)生,每份成績表中的成績信息包括:學(xué)號(9位字符),姓名(8位字符),成績(百分制),備注(20位字符)。設(shè)計程序以處理一個班級的成績信息,包括輸入、輸出、查詢(給定分數(shù)以上或以下的學(xué)生信息)、按分數(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é)號。 cinstudent[i].num。 cout輸入姓名。 cinstudent[i].name。 cout輸入成績。 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輸入分數(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。}實驗七, minutes和seconds作為數(shù)據(jù)成員的Time類。設(shè)計了成員函數(shù)將兩個Time對象相加(即時間相加),并進行相應(yīng)的檢查,查看增加的分鐘數(shù)及秒數(shù)是否大于59。如果秒數(shù)大于59,則分鐘數(shù)向前遞增1。類似地,如果分鐘數(shù)大于59,則小時數(shù)向前增1。include class Time{private: int hours, minutes, seconds。public: void get_time()
點擊復(fù)制文檔內(nèi)容
外語相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1