1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<graphics.h> 5 #include<conio.h> 6 #include<math.h> 7 #include<dos.h> 8 #define S 16 9 #define HZK "c:\hzk16" 10 long app=0,opple=0,Akm=0,sdibt=0; 11 int x=60,y=80; 12 char app1[123]; 13 void newxy(); 14 void cursor(); 15 void dispz(); 16 void my_sound(); 17 void load_pic(); 18 void save_pic(); 19 void input(); 20 void read_date(); 21 long Mouse_operate(); 22 void disphz(); 23 int oi=0; 24 struct HEAD 25 { 26 char file_type; 27 char file_date[3]; 28 long file_num; 29 short file_width; 30 short rec_width; 31 } head; 32 struct file 33 { 34 char field_name[10]; 35 char field_type[2]; 36 long field_start; 37 char field_width; 38 char field_dight; 39 } Fild; 40 struct ranklist 41 { 42 char name[123]; 43 double english; 44 double math; 45 double sum; 46 double computer; 47 } p; 48 union input 49 { 50 int key; 51 char cmp[2]; 52 } key; 53 int cmp(const void *a,const void *b) 54 { 55 struct ranklist *c=(struct ranklist *)a; 56 struct ranklist *d=(struct ranklist *)b; 57 if(c->sum==d->sum) 58 return d->english-c->english; 59 return d->sum-c->sum; 60 } 61 void input() 62 { 63 int gmode,gdriver=DETECT; 64 long lenth=0,flag=0,m,k=0; 65 char str[112],arr[]= {"Please input your secret"},ch; 66 initgraph(&gdriver,&gmode,""); 67 cleardevice(); 68 setcolor(4); 69 setcolor(15); 70 bar(110,120,310,150); 71 disphz(110,100,"请输入数据库文件名,回车键结束",15,1); 72 disphz(110,180,"提示",15,1); 73 setcolor(15); 74 outtextxy(142,215,"1."); 75 disphz(155,210,"可以带盘符和路径,如:",15,1); 76 setcolor(15); 77 outtextxy(380,215,"c:\tc\ss.dbf"); 78 setcolor(15); 79 outtextxy(145,235,"2.dbf"); 80 disphz(185,230,"可省略",15,1); 81 memset(app1,0,sizeof(app1)); 82 do 83 { 84 flag++; 85 if(flag%2==0) 86 setcolor(15); 87 else 88 setcolor(0); 89 line(110+lenth*16,150,110+lenth*16+10,150); 90 delay(200); 91 } 92 while(!kbhit()); 93 setcolor(15); 94 line(110+lenth*16,150,110+lenth*16+10,150); 95 while(1) 96 { 97 98 ch=getch(); 99 if(ch!=8&&ch!=' ') 100 { 101 str[k++]=ch; 102 str[k]='