📄 sun_1.c
字号:
#include <graphics.h>
#include <alloc.h>
#include <process.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <conio.h>
#include <time.h>
#include <bios.h>
#include <ctype.h>
#include <string.h>
#include <c:\tc\sun_110.c>
#include <c:\tc\sun_111.c>
#define KEY_DOWN 80
#define KEY_UP 72
#define KEY_ESC 1
#define KEY_ALT_X 45
#define KEY_ENTER 28
#define KEY_ALT_F 33
#define KEY_ALT_S 31
#define KEY_RIGHT 77
#define KEY_LEFT 75
#define KEY_F 33
#define KEY_I 23
#define KEY_G 34
#define KEY_O 24
#define KEY_H 35
#define KEY_M 50
#define KEY_Q 16
#define KEY_W 17
#define KEY_A 30
struct information
{char NUMBER[30];
char WAGE[30];
char TEL[30];
char NAME[30];
char NAME1[30];
char SEX[30];
char BORN[30];
char CAREER[30];
char POSATION[30];
char ADDRESS[30];
}WORKER[50];
struct information str[50];
struct information string[50];
int size,*buffer,key,i,w,count=0,m,remember,y,t,e;
char g;
FILE *fp,*fp1,*fp2;
main ()
{
int graphdriver=DETECT,graphmode;
/* registerbgidriver(EGAVGA_driver);
registerbgifont(TRIPLEX_FONT);*/
initgraph(&graphdriver,&graphmode,"");
CARTOON();
BOX();
{size=imagesize(10,60,72,101);
buffer=malloc(size);
getimage(10,60,72,101,buffer);
}
MAIN_MENU();
OPERATION();
getch();
closegraph();
}
BOX(void)
{
setcolor(6);
setlinestyle(0,0,3);
rectangle(1,1,639,479);
setlinestyle(2,0,1);
rectangle(4,4,636,476);
setlinestyle(0,0,3);
rectangle(7,7,633,473);
}
MAIN_MENU(void)
{ static char *MENU[]={"FILE","INPUT","GLANCE","OUTPUT"};
line(7,58,633,58);
for(i=0;i<4;i++)
{setcolor(5);
setfillstyle(1,5);
fillellipse(90+i*150,32,50,25);
floodfill(57+i*150,32,5);
}
settextstyle(0,0,2);
settextjustify(1,1);
setcolor(14);
for(i=0;i<4;i++)
outtextxy(90+i*150,32,MENU[i]);
}
OPERATION(void)
{int j=0,k=0;
static char *SUBMENU[]={"HELP","MAKER","QUIT"};
static char *MENU[]={"FILE","INPUT","GLANCE","OUTPUT"};
static char *SUB[]={"BY WAGE","BY ACADEMIC CAREER"};
do
{
key=GET_KEY();
if(k==0&&key==KEY_ENTER||key==KEY_F)
{ settextstyle(0,0,2);
settextjustify(1,1);
setcolor(3);
outtextxy(90,32,"FILE");
for(i=0;i<3;i++)
{setcolor(5);
fillellipse(90,85+i*50,50,25);
setfillstyle(1,5);
floodfill(90,85+i*50,5);
}
setcolor(14);
for(i=0;i<3;i++)
outtextxy(90,85+i*50,SUBMENU[i]);
do
{key=GET_KEY();
if(j==1&&key==KEY_ENTER&&count==0||key==KEY_H&&count==0)/*HELP*/
{for(i=0;i<10;i++)
for(w=0;w<10;w++)
putimage(10+62*i,60+41*w,buffer,COPY_PUT);
setcolor(2);settextjustify(0,1);
outtextxy(40,100,"1,[ INPUT ]--put the worker's");
outtextxy(40,120,"information into the file/");
outtextxy(40,140,"2,[ GLANCE ]--get the worker's");
outtextxy(40,160,"information from the file one by one/");
outtextxy(40,180,"3,[ OUTPUT ]--output the information");
outtextxy(40,200,"BY WHICH WAY!/");
outtextxy(40,220,"4,You can control the menu by");
outtextxy(40,240,"ESC,ENTER,LIGHT BOUTTON and SMART KEY!/");
setcolor(14);circle(340,370,50);ellipse(340,380,0,360,8,18);
arc(360,350,0,180,10);arc(320,350,0,180,10);
ellipse(450,370,0,360,8,50);circle(450,450,8);
arc(200,360,285,540,40);arc(200,360,270,540,30);
line(160,360,170,360);line(200,390,200,430);
line(210,400,210,430);line(200,430,210,430);circle(205,450,8);
count++;
}
else if(j==2&&key==KEY_ENTER&&count==0||key==KEY_M&&count==0)
{for(i=0;i<10;i++)
for(w=0;w<10;w++)
putimage(10+62*i,60+41*w,buffer,COPY_PUT);
setcolor(14);setfillstyle(6,14);
bar3d(200,150,400,300,50,1);
line(200,200,400,200);line(200,250,400,250);
setcolor(0);setfillstyle(1,0);
fillellipse(300,175,7,5);
fillellipse(300,225,7,5);
fillellipse(300,275,7,5);
setcolor(4);settextstyle(0,0,3);
outtextxy(340,330,"IT IS DESIANED BY----");
setcolor(14);
outtextxy(340,390,"SUN SHUCHUN->(200181072)!");
setcolor(2);
outtextxy(340,450,"electronic institute");
count++;
}
else if(j==3&&key==KEY_ENTER||key==KEY_Q&&count==0)
{CARTOON1();getch();exit(0);}
else if(key==KEY_DOWN&&count==0)
{
j++;
if(j>3)
{j=1;setcolor(14);outtextxy(90,185,SUBMENU[2]);}
if(j>1)
{setcolor(14);outtextxy(90,35+(j-1)*50,SUBMENU[j-2]);}
setcolor(9);outtextxy(90,35+j*50,SUBMENU[j-1]);
}
else if(key==KEY_UP&&count==0)
{
j--;
if(j<1)
{j=3;setcolor(14);outtextxy(90,85,SUBMENU[0]);}
if(j<3)
{setcolor(14);outtextxy(90,185-(2-j)*50,SUBMENU[j]);}
setcolor(9);outtextxy(90,185-(3-j)*50,SUBMENU[j-1]);
}
else if(key==KEY_ESC)
{
for(i=0;i<10;i++)
for(w=0;w<10;w++)
putimage(10+62*i,60+41*w,buffer,COPY_PUT);
j=0;count=0;
settextstyle(0,0,2);settextjustify(1,1);
break;
}
}while(1);
}
else if(k==1&&key==KEY_ENTER&&count==0||key==KEY_I&&count==0) /*CASE1__INPUT */
{setcolor(3);
arc(180,110,90,180,30);
arc(480,110,90,180,30);
line(180,80,480,80);
line(150,110,150,400);
line(450,110,450,400);
arc(120,400,270,360,30);
arc(420,400,270,360,30);
line(120,430,420,430);
setcolor(14);
circle(550,350,50);
ellipse(500,250,0,360,8,16);
ellipse(550,230,0,360,8,16);
putpixel(500,250,14);
putpixel(550,230,140);
arc(500,300,0,85,50);
arc(500,300,350,50,85);
arc(550,320,225,315,50);
PUT();
count++;
}
else if(k==2&&key==KEY_ENTER&&count==0||key==KEY_G&&count==0) /*CASE2__GLANCE*/
{setcolor(3);
arc(180,110,90,180,30);
arc(480,110,90,180,30);
line(180,80,480,80);
line(150,110,150,400);
line(450,110,450,400);
arc(120,400,270,360,30);
arc(420,400,270,360,30);
line(120,430,420,430);
GLANCE();
count++;
}
else if(k==3&&key==KEY_ENTER||key==KEY_O)/*OUTPUT*/
{ settextstyle(0,0,1);
settextjustify(1,1);
for(i=0;i<2;i++)
{setcolor(5);
fillellipse(540,85+i*50,80,25);
setfillstyle(1,5);
floodfill(540,85+i*50,5);
}
setcolor(14);
for(i=0;i<2;i++)
outtextxy(540,85+i*50,SUB[i]);
moveto(540,35);
do
{key=GET_KEY();
if(j==1&&key==KEY_ENTER&&count==0||key==KEY_W&&count==0)
{for(i=0;i<10;i++)
for(w=0;w<10;w++)
putimage(10+62*i,60+41*w,buffer,COPY_PUT);
setcolor(9);
rectangle(50,70,590,410);
line(230,70,230,410);
line(410,70,410,410);
line(50,150,590,150);
WAGE();
count++;
}
else if(j==2&&key==KEY_ENTER&&count==0||key==KEY_A&&count==0)
{for(i=0;i<10;i++)
for(w=0;w<10;w++)
putimage(10+62*i,60+41*w,buffer,COPY_PUT);
setcolor(9);
rectangle(50,70,590,410);
line(230,70,230,410);
line(410,70,410,410);
line(50,150,590,150);
CAREER();
count++;
}
else if(key==KEY_DOWN&&count==0)
{ j++;
if(j>2)
{j=1;setcolor(14);outtextxy(540,135,SUB[1]);}
if(j>1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -