count==DEEP/2+1) sum=(p->num+mid)/2; else mid=p->num; } count++; } p=p->next; } for (i=0;i<num;i++){ printf("\n 箱%d:",i+1); for (j=0;j<DEEP;j++) printf("%d ",box[i]); }} // 边界值 void boundary(){ printf("\n 边界值平滑后为: \n"); p=head->next; count=1; box=(int *)malloc(sizeof(int)*num*2); num=0; while(p!=NULL){ if(count==DEEP){ box[2*num+1]=p->num; count=1; num++; } else{ if(count==1) { box[2*num]=p->num; } count++; } p=p->next; } p=head->next; count=1; num=0; while(p!=NULL){ if(count==1) printf(" 箱%d:",num); if((p->num-box[2*num])>(box[2* num+1]-p->num)){ printf("%d ",box[2*num+1]); } else printf("%d ",box[2*num]); if(count==DEEP){ printf("\n"); count=0; num++; } count++; p=p->next; }} 实验数据文件: data .txt 用空格分开 13 15 16 16 19 20 20 21 22 22 25 25 25 25 30 33 33 35 35 35 35 36 40 45 46 52 70 5 六、结果截图