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

正文內(nèi)容

c語言上機實驗報告(編輯修改稿)

2025-06-19 18:04 本頁面
 

【文章內(nèi)容簡介】 eint dizhi(int *p){ int s。 p=amp。s。 printf(地址是:%d\n,p)。 return p。}main(){ int i,s,a[10],*p。 for(i=0。i10。i++) { a[i]=rand()%10。 printf(%d ,a[i])。 } printf(\n)。 s=a[0]。 for(i=0。i10。i++) { if(sa[i+1]) s=a[i]。 }printf(最大數(shù)是;%d\n,s)。 dizhi(amp。s)。}青 島 理 工 大 學課程實驗報告課程名稱計算機程序設計 (C)班級軟件111實驗日期2012516姓名趙亞東學號201107209實驗成績實驗名稱指針實驗目的及要求,學會指針變量的初始化以及指針可以參與的運算。、理解行指針(或數(shù)組指針)的概念。(即二級指針)。實驗環(huán)境Visual C++ window7實驗內(nèi)容6.編寫程序。讀入三個浮點數(shù),將整數(shù)部分和小數(shù)部分分別輸出。要求使用指針作形參。7.編寫一個函數(shù),返回數(shù)組元素中最大值的地址,并在主函數(shù)中輸出該元素。算法描述及實驗步驟實驗6 定義函數(shù),指針做形參。定義a為整數(shù)部分,*pa既是小數(shù)部分。然后輸出。主函數(shù)中,鍵入三個浮點型數(shù)。并使用fu函數(shù)。實驗7定義dizhi函數(shù),指針做形參。返回地址。定義主函數(shù),以及一個數(shù)組。調(diào)用dizhi函數(shù),輸出數(shù)組和最大值。調(diào)試過程及實驗結果總結,避免邏輯上的錯誤,加大編程時的難度。,編寫程序方便靈活,可以實現(xiàn)多個值的返回附錄實驗6includevoid fu(float *p){ int a。 a=(int)*p。 printf(整數(shù)部分是%d 小數(shù)部分是%f\n,a,*pa)。}main(){ float a[3]。 int i。 for(i=0。i3。i++) { scanf(%f,amp。a[i])。 fu(amp。a[i])。 }} 實驗7includeint dizhi(int *p){ int s。 p=amp。s。 printf(地址是:%d\n,p)。 return p。}main(){ int i,s,a[10],*p。 for(i=0。i10。i++) { a[i]=rand()%10。 printf(%d ,a[i])。 } printf(\n)。 s=a[0]。 for(i=0。i10。i++) { if(sa[i+1]) s=a[i]。 }printf(最大數(shù)是;%d\n,s)。 dizhi(amp。s)。}青 島 理 工 大 學課程實驗報告課程名稱計算機程序設計 (C)班級軟件111實驗日期2011530姓名趙亞東學號201107209實驗成績實驗名稱實驗七 鏈表實驗目的及要求1.掌握結構體類型變量的定義和使用。2.掌握結構體類型數(shù)組的概念和應用。3.掌握鏈表的概念,初步學會對鏈表進行操作。實驗環(huán)境VC++實驗內(nèi)容1.編寫程序。有5個學生,每個學生的數(shù)據(jù)包括學號、姓名、3門課的成績,從鍵盤輸入5個學生數(shù)據(jù),要求輸出3門課總平均成績,以及最高分的學生的數(shù)據(jù)(包括學號、姓名、3門課的成績、平均分數(shù))。2.建立一個學生鏈表,每個結點包括:學號、姓名、性別、年齡。輸入一個年齡,如果鏈表中的結點所包含的年齡等于此年齡,則將此結點刪去。算法描述及實驗步驟第一題定義一個結構體變量,包含學號、姓名、3門課的成績定義一個可以輸入學生信息的函數(shù)。定義一個函數(shù)可以求平均分并返回。輸出3門課總平均成績,以及最高分的學生的數(shù)據(jù)(包括學號、姓名、3門課的成績、平均分數(shù))。第二題定義一個結構體變量,包括學號、姓名、性別、年齡和指向下一個節(jié)點的指針。創(chuàng)建鏈表,輸入學生信息。定義一個可以輸出學生信息函數(shù)。定義一個可以刪除節(jié)點的函數(shù),當輸入一個年齡時,如果鏈表中的結點所包含的年齡等于此年齡,則將此結點刪去。調(diào)試過程及實驗結果12 總結熟練地掌握共用體;在寫程序時可以熟練地使用鏈表進行數(shù)據(jù)操作。附錄/////第一題代碼如下:includedefine N 5void input(struct student stud[])。double av1(struct student stud[])。double av2(struct student stud[])。double av3(struct student stud[])。int max(struct student stud[])。struct student{int no。char name[10]。double degree1。double degree2。double degree3。}。void main(){struct student stud[N]。double aver[3],avg。int a,i。input(stud)。aver[0]=av1(stud)。aver[1]=av2(stud)。aver[2]=av3(stud)。a=max(stud)。avg=(stud[a].degree1+stud[a].degree2+stud[a].degree3)/。for(i=0。i3。i++){ printf(第%d門平均分:\t,i+1)。 printf(%.2lf\n,aver[i])。}printf(分數(shù)最高的學生信息如下:\n)。printf(%d\t%s\t%.2lf %.2lf %.2lf %.2lf\n,stud[a].no,stud[a].name,stud[a].degree1,stud[a].degree2,stud[a].degree3,avg)。}void input(struct student stud[])//輸入N個學生的信息{int i。printf(學生信息輸入格式:學號、姓名 、分開輸入三門分數(shù)\n)。for(i=0。iN。i++){printf(輸入第%d個學生信息:\n,i+1)。scanf(%d%s%lf%lf%lf,amp。stud[i].no,stud[i].name,amp。stud[i].degree1,amp。stud[i].degree2,amp。stud[i].degree3)。}}double av1(struct student stud[])//計算第一門課的平均分{int i。double a=,b。for(i=0。iN。i++)a+=stud[i].degree1。b=a/N。return b。}double av2(struct student stud[])//計算第二門課的平均分{int i。double a=,b。for(i=0。iN。i++)a+=stud[i].degree2。b=a/N。return b。}double av3(struct student stud[])//計算第三門課的平均分{int i。double a=,b。for(i=0。iN。i++)a+=stud[i].degree3。b=a/N。return b。}int max(struct student stud[])//查找分數(shù)最大的學生下標{double m=0,a[N]。int i,k=0。for(i=0。iN。i++){a[i]=stud[i].degree1+stud[i].degree2+stud[i].degree3。if(ma[i]){m=a[i]。k=i。}}return k。}/// 第二題代碼如下:includeincludedefine N 3typedef struct stud {int no。char name[10]。char sex[10]。int age。struct stud *next。}Stud。Stud *create()。void show(Stud *head)。void delet(Stud *head)。Stud *getnode(Stud *head,int n)。void shan(Stud *head)。void main()//主函數(shù){Stud *head。int n。do{printf(1創(chuàng)建鏈表,2顯示鏈表,3刪除相同年齡,0退出操作\n)。scanf(%d,amp。n)。switch(n){case 1:head=create()。break。case 2:show(head)。break。case 3:delet(head)。break。defa
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1