📄 sun_1.c
字号:
{setcolor(14);outtextxy(540,35+(j-1)*50,SUB[j-2]);}
setcolor(9);outtextxy(540,35+j*50,SUB[j-1]);
}
else if(key==KEY_UP&&count==0)
{j--;
if(j<1)
{j=2;setcolor(14);outtextxy(540,85,SUB[0]);}
if(j<2)
{setcolor(14);outtextxy(540,135-(1-j)*50,SUB[j]);}
setcolor(9);outtextxy(540,135-(2-j)*50,SUB[j-1]);
}
else if(key==KEY_ESC)
{
for(i=0;i<10;i++)
for(j=0;j<10;j++)
putimage(10+62*i,60+41*j,buffer,COPY_PUT);
settextjustify(1,1);settextstyle(0,0,2);
j=0;count=0;
break;
}
}while(1);
}
else if(key==KEY_RIGHT&&count==0)
{
k++;
if(k>3)
{k=0;setcolor(14);outtextxy(540,32,MENU[3]);
}
if(k>0)
{setcolor(14);outtextxy(90+150*(k-1),32,MENU[k-1]);
}
setcolor(3);outtextxy(90+150*k ,32,MENU[k]);
}
else if(key==KEY_LEFT&&count==0)
{
k--;
if(k<0)
{k=3;setcolor(14);outtextxy(90,32,MENU[0]);
}
if(k<3)
{setcolor(14);outtextxy(540-150*(2-k),32,MENU[k+1]);
}
setcolor(3);outtextxy(540-150*(3-k),32,MENU[k]);
}
else if(key==KEY_ESC)
{ for(i=0;i<10;i++)
for(j=0;j<10;j++)
putimage(10+62*i,60+41*j,buffer,COPY_PUT);count=0;j=0;
}
} while(1);
}
PUT(void)
{
setcolor(2);
settextstyle(0,0,1);
settextjustify(1,1);
{outtextxy(200,118,"NUMBER:");
outtextxy(200,150,"NAME");
outtextxy(200,182,"BIRTHDAY");
outtextxy(200,214,"SEX");
outtextxy(200,246,"TEL");
outtextxy(200,278,"WAGE");
outtextxy(200,310,"CAREER");
outtextxy(200,342,"POSATION");
outtextxy(200,374,"ADDRESS");
setcolor(4);
outtextxy(200,130,"START:");
setcolor(14);
rectangle(160,105,440,393);
for(i=0;i<9;i++)
line(160,105+i*32,440,105+i*32);
line(240,105,240,390);
}
fp=fopen("INPUT","a");
for(i=0;;i++)
{
gotoxy(35, 8); scanf("%s",WORKER[i].NUMBER);
gotoxy(35,10); scanf("%s%s",WORKER[i].NAME,WORKER[i].NAME1);
gotoxy(35,12); scanf("%s",WORKER[i].BORN);
gotoxy(35,14); scanf("%s",WORKER[i].SEX);
gotoxy(35,16); scanf("%s",WORKER[i].TEL);
gotoxy(35,18); scanf("%s",WORKER[i].WAGE);
gotoxy(35,20); scanf("%s",WORKER[i].CAREER);
gotoxy(35,22); scanf("%s",WORKER[i].POSATION);
gotoxy(35,24); scanf("%s",WORKER[i].ADDRESS);
setcolor(14); settextstyle(0,0,1);
outtextxy(220,415,"NEXT?--ENTER");
outtextxy(350,415,"QUIT?--x");
fwrite(&WORKER[i],sizeof(struct information),1,fp);
g=getch();
if(g=='x'||g=='X')
{ setcolor(4);
settextstyle(0,0,2);settextjustify(1,1);
outtextxy(410,450,"press 'ESC' to main menu!");
setfillstyle(1,0);
for(m=0;m<9;m++) bar(241,106+m*32,439,136+m*32);
break;
}
setfillstyle(1,0);bar(170,410,410,420);
for(m=0;m<9;m++) bar(241,106+m*32,439,136+m*32);
}
settextjustify(1,1);settextstyle(0,0,2);
fclose(fp);
}
GLANCE(void)
{setcolor(2);
settextstyle(0,0,1);
settextjustify(1,1);
{outtextxy(200,118,"NUMBER:");
outtextxy(200,150,"NAME");
outtextxy(200,182,"BIRTHDAY");
outtextxy(200,214,"SEX");
outtextxy(200,246,"TEL");
outtextxy(200,278,"WAGE");
outtextxy(200,310,"CAREER");
outtextxy(200,342,"POSATION");
outtextxy(200,374,"ADDRESS");
setcolor(14);
rectangle(160,105,440,393);
for(i=0;i<9;i++)
line(160,105+i*32,440,105+i*32);
line(240,105,240,390);
}
fp=fopen("INPUT","r");
for(i=0;fread(&WORKER[i],sizeof(struct information),1,fp)==1;i++)
remember=i;
for(i=0;i<=remember;i++)
{
gotoxy(35, 8); printf("%s",WORKER[i].NUMBER);
gotoxy(35,10); printf("%s %s",WORKER[i].NAME,WORKER[i].NAME1);
gotoxy(35,12); printf("%s",WORKER[i].BORN);
gotoxy(35,14); printf("%s",WORKER[i].SEX);
gotoxy(35,16); printf("%s",WORKER[i].TEL);
gotoxy(35,18); printf("%s",WORKER[i].WAGE);
gotoxy(35,20); printf("%s",WORKER[i].CAREER);
gotoxy(35,22); printf("%s",WORKER[i].POSATION);
gotoxy(35,24); printf("%s",WORKER[i].ADDRESS);
setcolor(14); settextstyle(0,0,1);
outtextxy(220,415,"NEXT?--ENTER");
outtextxy(400,415,"QUIT--X");
g=getch(); setfillstyle(1,0);
for(m=0;m<9;m++) bar(241,106+m*32,439,136+m*32);
if(g=='x'||g=='X')
{ setcolor(4);setfillstyle(1,0);
settextstyle(0,0,2);settextjustify(1,1);
outtextxy(410,450,"press 'ESC' to the main menu?!");
for(t=0;t<9;t++) bar(241,106+t*32,439,136+t*32);
g=NULL;break;
}
if(i==remember)
{ setcolor(4);
settextstyle(0,0,2);settextjustify(1,1);
outtextxy(410,450,"press 'ESC' to the main menu!");
g=NULL;break;
}
}
settextjustify(1,1);settextstyle(0,0,2);
fclose(fp);
}
WAGE(void)
{ fp1=fopen("INPUT1","w+");
fp=fopen("INPUT","r");
for(i=0; fread(&WORKER[i],sizeof(struct information),1,fp)==1;i++)
remember=i;
setcolor(2);
settextstyle(0,0,3);
settextjustify(1,1);
outtextxy(130,110,"NUMBER");
outtextxy(320,110,"NAME");
outtextxy(500,110,"WAGE");
for(t=0;t<remember;t++)
for(e=0;e<remember-t;e++)
if(strcmp(WORKER[e].WAGE,WORKER[e+1].WAGE)>0)
{
str[e]=WORKER[e+1];WORKER[e+1]=WORKER[e];WORKER[e]=str[e];
}
for(e=0;e<=remember;e++)
fwrite(&WORKER[e],sizeof(struct information),1,fp1);
gotoxy(75,23);printf("page");gotoxy(75,24);printf("1");
for(t=0,y=0;t<=remember;t++)
{fread(&WORKER[t],sizeof(struct information),1,fp1);
gotoxy(10,12+(t-y*6)*2); printf("%s",WORKER[t].NUMBER);
gotoxy(35,12+(t-y*6)*2); printf("%s %s",WORKER[t].NAME,WORKER[t].NAME1);
gotoxy(55,12+(t-y*6)*2); printf("%s",WORKER[t].WAGE);
if(t%6==0&&t>0)
{ y++;settextstyle(0,0,2);
setcolor(14);settextstyle(0,0,2);
outtextxy(150,425,"NEXT?--ENTER");
setfillstyle(1,0);getch();
bar(71,151,229,409);
bar(231,151,409,409);
bar(411,151,589,409);
gotoxy(75,23);printf("page");gotoxy(75,24);printf("%d",y+1);
}
if(t==remember)
{ setcolor(4);
settextstyle(0,0,2);settextjustify(1,1);
outtextxy(410,450,"press 'ESC' to the main menu!");g=NULL;
break;
}
}
settextjustify(1,1);settextstyle(0,0,2);
fclose(fp1);
fclose(fp);
}
CAREER(void)
{ fp2=fopen("INPUT2","w+");
fp=fopen("INPUT","r");
for(i=0; fread(&WORKER[i],sizeof(struct information),1,fp)==1;i++)
remember=i;
setcolor(2);
settextstyle(0,0,3);
settextjustify(1,1);
outtextxy(130,110,"NUMBER");
outtextxy(320,110,"NAME");
outtextxy(500,110,"CAREER");
for(t=0;t<remember;t++)
for(e=0;e<remember-t;e++)
if(strcmp(WORKER[e].CAREER,WORKER[e+1].CAREER)>0)
{
str[e]=WORKER[e+1];WORKER[e+1]=WORKER[e];WORKER[e]=str[e];
}
for(e=0;e<=remember;e++)
fwrite(&WORKER[e],sizeof(struct information),1,fp2);
gotoxy(75,23);printf("page");gotoxy(75,24);printf("1");
for(t=0,y=0;t<=remember;t++)
{fread(&WORKER[t],sizeof(struct information),1,fp2);
gotoxy(10,12+(t-y*6)*2); printf("%s",WORKER[t].NUMBER);
gotoxy(35,12+(t-y*6)*2); printf("%s %s",WORKER[t].NAME,WORKER[t].NAME1);
gotoxy(55,12+(t-y*6)*2); printf("%s",WORKER[t].CAREER);
if(t%6==0&&t>0)
{y++; settextstyle(0,0,2);
setcolor(14);settextstyle(0,0,2);
outtextxy(150,425,"NEXT?--ENTER");
setfillstyle(1,0);getch();
bar(71,151,229,409);
bar(231,151,409,409);
bar(411,151,589,409);y+=1/6;
gotoxy(75,23);printf("page");gotoxy(75,24);printf("%d",y+1);
}
if(t==remember)
{ setcolor(4);
settextstyle(0,0,2);settextjustify(1,1);
outtextxy(410,450,"press 'ESC' to the main menu!");g=NULL;
break;
}
}
settextjustify(1,1);settextstyle(0,0,2);
fclose(fp2);
fclose(fp);
}
GET_KEY()
{ union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -