发布信息

自己现..跪求一道课程设计答案 课程设计C言语版 数据结构 完了追 如今只能给100分 有哪..位的大仙帮帮我 (自己下跪)

     2024-08-14 04:25:05     972
有哪..位的大仙帮帮我

本文目录导航:

数据结构 课程设计C言语版 自己现..跪求一道课程设计答案 有哪..位的大仙帮帮我,如今只能给100分,完了追

#include stdio.h# include bios.h#include dos.h#include conio.h #include stdlib.h #include string.h#include mem.h#include ctype.h #include alloc.htypedef struct z1{ char no[11]; char name[15]; float jbgz; float koukuan; float yfgz; float shuijin; float sfgz; struct z1 *prior; struct z1 *next;}SALARY; struct z1 *First; struct z1 *Last; void init();void create();void calc(); void delete(); void search(); void save();void load();void computer(); void insert();void append(); void copy(); void sort();void index();void total();void list(); void print(SALARY *p);void display();float fax(float x);int menu_select();main(){ int i; clrscr(); for(;;) {switch(menu_select()) {case 0:init();break;case 1:create();break; case 2:list();break;case 3:display();break;case 4:calc();break;case 5:search();break;case 6:delete();break;case 7:insert();break;case 8:append();break;case 9:save();break;case 10:load(); break;case 11:copy();break;case 12:sort();break;case 13:computer();break; case 14:index();break;case 15:total();break;case 16:exit(0);} }}menu_select(){ char *f[]= { **************MENU*************, 0. init list, 1. Enter list, 2. List all \n, 3. Display record by step, 4. Calc the salary, 5. Search record on name, 6. Delete a record, 7. Insert record to list, 8. Appendrecord to file, 9. Save){ flag=1; break;} gotoxy(13,8+x);inputs(info->name,14); gotoxy(30,8+x); scanf(%f,&temp); info->jbgz=temp; info->koukuan=0; info->sfgz=0; info->shuijin=0; info->yfgz=0; if(p==NULL){ First=Last=info; First->prior=NULL; Last->next=NULL; }else { info->next=p; info->prior=p->prior; p->prior=info;}p=info;First=info; x+=2; gotoxy(1,8+x);i++; if(i%9==0) break; }gotoxy(1,8+x); } printf(|----------|----------------|--------|);}inputs(char *s, int count){ char p[255]; do{scanf(%s,p);if(strlen(p)>count)printf(\n too long! \n); }while(strlen(p)>count); strcpy(s,p); }void list(){ int i=0,n; SALARY *p; clrscr(); p=First; while(i%10==0&&p!=NULL) {i=0; clrscr(); printf(\n\n\n); printf(*************************************SALARY***********************************\n); printf(|nO|name | jbgz| koukuan | yfgz| shuijin | sfgz|\n);printf(|----------|---------------|---------|---------|---------|---------|---------|\n);while(p!=NULL){printf(|%-10s|%-15s|%9.2f|%9.2f|%9.2f|%9.2f|%9.2f|\n,p->no,p->name,p->jbgz,p->koukuan,p->yfgz,p->shuijin,p->sfgz);p=p->next;i++; if(i%10==0) break;}printf(****************************************end***********************************\n);printf(Press any key congtinue...\n);getch(); }}void display(){ int ch; SALARY *p; clrscr(); p=First; if(p==NULL) {printf(record is empty!\n);return; } else {print(p); for(;;){printf(\n\n0. Quit 1. \n\n);printf(\nplease select 0~4:); scanf(%d,&ch); if(ch==0) break;switch(ch) { case 1:p=p->prior;if(p==NULL)p=First;break; case 2:p=p->next;if(p==NULL) p=Last;break; case 3:p=First;break; case 4:p=Last;break; }print(p);} }}void print(SALARY *p){ if(p) {clrscr();printf(\n\n\n);printf(************************************SALARY************************************\n);printf(|no|name | jbgz| koukuan| yfgz| shuijin | sfgz |\n); printf(|----------|---------------|---------|---------|---------|---------|---------|\n); printf(|%-10s|%-15s|%9.2f|%9.2f|%9.2f|%9.2f|%9.2f|\n, p->no,p->name,p->jbgz,p->koukuan,p->yfgz,p->shuijin,p->sfgz);printf(***************************************end***************************** *******\n); }}void calc(){ int x; int i=0; float temp; SALARY *p; clrscr(); p=First; while(p!=NULL) {x=0;clrscr();gotoxy(1,3);printf(***************************gongziguanli************************************); gotoxy(1,5);printf(|--------------------------------------------------------------------------|);gotoxy(1,6);printf(|no|name|jbgz|koukuan |yfgz|shuijin |sfgz|);while(p!=NULL) {gotoxy(1,7+x);printf(|----------|----------------|--------|----------|--------|--------|--------|);gotoxy(1,8+x);printf(|);gotoxy(12,8+x);printf(|);gotoxy(29,8+x);printf(|);gotoxy(38,8+x);printf(|);gotoxy(49,8+x);printf(|);gotoxy(58,8+x);printf(|);gotoxy(67,8+x);printf(|);gotoxy(76,8+x);printf(|);gotoxy(2,8+x);printf(%-10s,p->no); gotoxy(13,8+x);printf(%-15s,p->name); gotoxy(30,8+x);printf(%.2f,p->jbgz);gotoxy(39,8+x);scanf(%f,&temp);p->koukuan=temp; p->yfgz=p->jbgz-p->koukuan; gotoxy(50,8+x);printf(%.2f,p->yfgz);gotoxy(59,8+x);p->shuijin=(p->yfgz-1000)*fax(p->yfgz); printf(%.2f,p->shuijin);gotoxy(68,8+x);p->sfgz=p->yfgz-p->shuijin;printf(%-8.2f,p->sfgz);x+=2; i++; if(i%9==0)break;p=p->next; }gotoxy(1,7+x);printf(|----------|----------------|--------|----------|--------|--------|--------|\n); printf(Press any key congtinue...\n);getch(); }}float fax(float x){ float f1; if(x<1000)return 0; switch((int)(x/1000)) {case 1:f1=0.05;break; case 2:f1=0.1;break; case 3:f1=0.15;break; case 4:f1=0.2;break; default:f1=0.3;break; } return f1;}void computer(){ SALARY *p; int i=0,a[7]={0},t100,t50,t20,t10,t5,t2,t1; float t; p=First; while(p!=NULL) {t100=(int)p->sfgz/100;a[0]=a[0]+t100; t=p->sfgz-t100*100; t50=(int)(t/50); a[1]=a[1]+t50; t=t-t50*50; t20=(int)(t/20); a[2]=a[2]+t20; t=t-t20*20; t10=(int)(t/10); a[3]=a[3]+t10; t=t-t10*10; t5=(int)(t/5); a[4]=a[4]+t5; t=t-t5*5; t2=(int)(t/2); a[5]=a[5]+t2; t=t-t2*2; t1=(int)(t); a[6]=a[6]+t1; p=p->next; } clrscr(); printf(\n\n\n***********ticket number***************\n); printf(--100-----50------20-----10-----5------2------1------\n); for(i=0;i<7;i++)printf(%5d,a[i]); printf(\n);}SALARY *find(char *no){ SALARY *p; p=First; while(p) {if(!strcmp(no,p->no))return p; p=p->next; } printf(not found\n); return NULL; }

求 《数据结构c言语版》 完整源代码(严蔚敏、吴伟民编著)

整顿严蔚敏所有数据结构资料:包含电子书、习题集答案、纯C代码、教学讲义和课件.还有数据结构笔记和数据结构1800温习例题与答案。下载地址1:下载地址2:下载地址3:这个 地址你去下载把 CSDN

相关内容 查看全部