论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > C语言程序设计教程
Tag:新手,函数,指针,数据类型,对象,Turbo,入门,运算符,数组,结构,二级,,tc,游戏,试题,问答,编译,视频教程

通过键盘操作的,想进行c图形化编程的可能有参考价值

文章类别:C语言程序设计 | 发表日期:2008-9-24 14:43:50

/*通过键盘操作的,想进行c图形化编程的可能有参考价值*/
#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<stdlib.h>
#include<ctype.h>
#define back textbackground
struct student           /*定义学生类型,用于存放借出的书籍*/
{
int carnum;
char lendbook[10];
}student[1000];
struct employ            /*定义职工类型*/
{
int employnum;
char employname[15];
int employage;
char employsex[2];
char employleve[10];
long int employtage;
}employ[50];
struct book              /*定义书的类型*/
{
int booknum;
char bookname[10];
char bookcreat[10];
int turefalse;           /*用于借书和还书模块判定一本书是否借出的条件*/
}book[1000];
struct car               /*借书卡的数据类型*/
{
int carnum;
char studentname[10];
int studentclass;
}car[100];
winset(int txtcolor,int backcolor,int choice)
{
char a1[]="查询图书",a2[]="借阅图书",a3[]="治理员",a4[]="还书",a5[]="退出";
window(33,5+choice,53,5+choice);
back(backcolor);
textcolor(txtcolor);
clrscr();
switch(choice)
{
case 1: cprintf("%s",a1); break;
case 2: cprintf("%s",a2); break;
case 3: cprintf("%s",a3); break;
case 4: cprintf("%s",a4); break;
case 5: cprintf("%s",a5); break;
}
}
winset3(int txtcolor,int backcolor,int choice)
{
char d1[]="增加卡号",d2[]="删除卡号",d3[]="卡号统计",d4[]="借书统计",d5[]="返回";
window(33,5+choice,53,5+choice);
back(backcolor);
textcolor(txtcolor);
clrscr();
switch(choice)
{
case 1: cprintf("%s",d1); break;
case 2: cprintf("%s",d2); break;
case 3: cprintf("%s",d3); break;
case 4: cprintf("%s",d4); break;
case 5: cprintf("%s",d5); break;
}
}
winset2(int txtcolor,int backcolor,int choice)
{

char c1[]="增加职工",c2[]="修改职工资料",c3[]="删除职工",c4[]="职工统计",c5[]="返回";
window(33,5+choice,53,5+choice);
back(backcolor);
textcolor(txtcolor);
clrscr();
switch(choice)
{
case 1: cprintf("%s",c1); break;
case 2: cprintf("%s",c2); break;
case 3: cprintf("%s",c3); break;
case 4: cprintf("%s",c4); break;
case 5: cprintf("%s",c5); break;
}
}
winset1(int txtcolor,int backcolor,int choice)
{
char b1[]="增加图书",b2[]="修改图书",b3[]="删除图书",b4[]="书籍统计",b5[]="职工治理系统",b6[]="学生治理系统",b7[]="返回";
window(33,5+choice,53,5+choice);
back(backcolor);
textcolor(txtcolor);
clrscr();
switch(choice)
{
case 1: cprintf("%s",b1); break;
case 2: cprintf("%s",b2); break;
case 3: cprintf("%s",b3); break;
case 4: cprintf("%s",b4); break;
case 5: cprintf("%s",b5); break;
case 6: cprintf("%s",b6); break;
case 7: cprintf("%s",b7); break;
}
}
lendcount()             /*其他的自己看就懂了,不行也可以qq联系:258032791,人妖也!愿意交爱好编程的交友,毕业没时间了,找工作忙,有其他的模块没写,发现什么问题自己改,*/
{
FILE *fp;
int i,n=0;
fp=fopen("record.txt","r");
clrview();
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++)
{
window(1,15+i,79,15+i);
back(9);
textcolor(3);
printf("卡号:%d 借出的书籍:%s ",student[i].carnum,student[i].lendbook);
n=n+1;
}
fclose(fp);
printf("目前共有%d本书借出\n",n);
printf("按任意键\n");
getch();
stuview();
}
huanbook()               /*还书函数*/
{
FILE *fp,*fp2;           /*定义两个文件指针,fp2用于修改数据时设立临时文件用,防止数据遭破坏*/
int i,n;
int carnum;
char lendbook[10];
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入你的卡号\n");
scanf("%d",&carnum);
fp=fopen("car.txt","r");       /*读取卡号记录*/
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++)   /*for循环判定卡号是否存在*/
{
if(car[i].carnum==carnum)      /*卡号存在,进入下一循环*/
{
n=i;
fclose(fp);
printf("请输入你要还的书的名字\n");
scanf("%s",lendbook);
fp=fopen("record.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++)   /*判定是否借阅了输入的书*/
{
if(strcmp(student[i].lendbook,lendbook)==0)      /*借阅了该书,进入下一循环,否则出错显示*/
{
fclose(fp);
fp=fopen("record.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++)
{
if(strcmp(student[i].lendbook,lendbook)==0)
{
continue;                                       /*删除还掉的书的借书记录*/
}
fwrite(&student[i],sizeof(struct student),1,fp2);  /*写入原来没还的书的记录*/
}
fclose(fp);
fclose(fp2);
fp=fopen("record.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp2)!=0;i++)
{
fwrite(&student[i],sizeof(struct student),1,fp);     /*将借书记录信息写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w");                    /*清临时文件的记录*/
fclose(fp2);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)    /*将书的记录写入临时文件,防止因为修改信息破坏以前的记录*/
{
if(i==n)
{
book[i].turefalse=1;
fwrite(&book[i],sizeof(struct book),1,fp2);          /*将还的书的原来状态设为无人借阅的*/                     
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp);            /*将临时文件写回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w");              /*清临时文件*/
fclose(fp2);
printf("还书完毕,按任意键返回\n");
getch();
firstview();
}
}
printf("你没有借这样的书,不要耍我,任意键返回\n");    /*出错提示*/
fclose(fp);
getch();
firstview();
}
}
printf("系统没这样的卡,和治理员联系,按任意键返回\n");   /*出错提示*/
fclose(fp);
getch();
firstview();
}
lendbook()
{
FILE *fp,*fp2;
int i,n;
int carnum;
clrview();
window(1,15,79,15);
back(9 );
textcolor(3);
printf("请你输入你的卡号\n");
scanf("%d",&carnum);
fp=fopen("car.txt","r");
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++)
{
if(car[i].carnum==carnum)
{
n=i;
fclose(fp);
printf("请输入你要借阅的书的名字\n");
scanf("%s",student[n].lendbook);
fp=fopen("book.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
if(book[i].turefalse==0) {printf("对不起,此书有人借出,请借其他书\n");fclose(fp);getch();firstview();}
else
fclose(fp);
fp=fopen("record.txt","a+");
student[n].carnum=carnum;
fwrite(&student[n],sizeof(struct student),1,fp);
fclose(fp);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
book[i].turefalse=0;
fwrite(&book[i],sizeof(struct book),1,fp2);
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w");
fclose(fp2);
printf("借书完毕,按任意键返回\n");
getch();
firstview();
}
}
printf("不存在这样的书,任意键返回\n");
fclose(fp);
getch();
firstview();
}
}
printf("你的卡号不存在,请申请新卡,按任意键返回\n");
fclose(fp);
getch();
firstview();
}
carcount()
{
FILE *fp;
int i,n=0;
fp=fopen("car.txt","r");
clrview();

for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++)
{
window(1,15+i,7,15+i);
back(9);
textcolor(3);
printf("第%d张卡信息<卡号:%d 姓名:%s 班级:%d>\n",i+1,car[i].carnum,car[i].studentname,car[i].studentclass);
n=n+1;
}
fclose(fp);
printf("目前共有%d张卡\n",n);
printf("按任意键\n");
getch();
stuview();
}
delcar()
{
FILE *fp,*fp2;
int i;
int carnum;
char choice;
fp=fopen("car.txt","r");
fp2=fopen("bookl.txt","w");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("假如你输入的卡号存在,系统自动删除该信息!假如不存在,系统不做任何改动\n");
printf("请输入你要删除的卡号:");
scanf("%d",&carnum);
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++)
{
if(car[i].carnum!=carnum)
{
fwrite(&car[i],sizeof(struct car),1,fp2);
}
}
fclose(fp);
fclose(fp2);
printf("是否真的要删除该卡?删除后该书籍的所有信息将无法恢复《Y/N》\n");
scanf("%s",&choice);
if(choice=='y'||choice=='Y')
{
fp=fopen("car.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&car[i],sizeof(struct car),1,fp2)!=0;i++)
{
fwrite(&car[i],sizeof(struct car),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
stuview();
}
else
{
printf("按任意键返回\n");
getch();
stuview();
}
}
addcar()
{
FILE *fp;
int i=0;
fp=fopen("car.txt","a+");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入卡号\n");
scanf("%d",&car[i].carnum);
printf("请你输入学生姓名\n");
scanf("%s",car[i].studentname);
printf("请你输入班级\n");
scanf("%d",&car[i].studentclass);
fwrite(&car[i],sizeof(struct car),1,fp);
fclose(fp);
printf("输入完毕,任意键返回\n");
getch();
stuview();
}
changemploy()
{
FILE *fp,*fp2;
char employname[10],choice;
int i;
fp=fopen("employ.txt","r");
fp2=fopen("bookl.txt","w");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入要修改的职工的书字\n");
scanf("%s",employname);
for(i=0;fread(&employ[i],sizeof(struct employ),1,fp)!=0;i++)
{
if(strcmp(employ[i].employname,employname)==0)
{
printf("你所要修改的职工的资料如下,请选择你要修改的内容\n");
printf("<职工号:%d职工名:%s 年龄:%d 性别:%s 学历:%s 工资:%d>\n",employ[i].employnum,employ[i].employname,employ[i].employage,employ[i].employsex,employ[i].employleve,employ[i].employtage);
printf("1:修改职工的号\n");
printf("2:修改职工名\n");
printf("3:修改职工年龄\n");
printf("4:修改职工工资\n");
printf("5:修改职工学历\n");
printf("请输入1-5:");
scanf("%s",&choice);
switch(choice)
{
case '1':
{
printf("请输入新的职工号\n");
scanf("%d",&employ[i].employnum);
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}break;
case '2':
{
printf("请输入新的职工姓名\n");
scanf("%s",employ[i].employname);
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}break;
case '3':
{
printf("请输入新的年龄\n");
scanf("%d",&employ[i].employage);
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}break;
case '4':
{
printf("请输入新的职工工资\n");
scanf("%d",&employ[i].employtage);
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}break;
case '5':
{
printf("请输入新的职工学历\n");
scanf("%s",employ[i].employleve);
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}break;
defaut:printf("没有这样的操作");break;
}
continue;
}
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("employ.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&employ[i],sizeof(struct employ),1,fp2)!=0;i++)
{

fwrite(&employ[i],sizeof(struct employ),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
employview();
}
employcount()
{
FILE *fp;
int i,n=0;
fp=fopen("employ.txt","r");
clrview();
for(i=0;fread(&employ[i],sizeof(struct employ),1,fp)!=0;i++)
{
window(1,15+i,79,15+i);
back(9);
textcolor(3);
printf("第%d职工的信息如下:\n<职工号:%d 职工名:%s 年龄:%d 性别:%s 学历:%s 工资:%d>",n+1,employ[i].employnum,employ[i].employname,employ[i].employage,employ[i].employsex,employ[i].employleve,employ[i].employtage);
n++;
}
fclose(fp);
printf("目前共有%d个职工\n",n);
printf("按任意键返回");
getch();
employview();
}
delemploy()
{
FILE *fp,*fp2;
int i;
char employname[10],choice;
fp=fopen("employ.txt","r");
fp2=fopen("bookl.txt","w");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请输入你要删除的职工名\n");
printf("假如你输入的职工存在,系统自动删除该信息!假如不存在,系统不做任何改动\n");
scanf("%s",employname);
for(i=0;fread(&employ[i],sizeof(struct employ),1,fp)!=0;i++)
{

if(strcmp(employname,employ[i].employname)!=0)
{
fwrite(&employ[i],sizeof(struct employ),1,fp2);
}
}
fclose(fp);
fclose(fp2);
printf("是否真的要删除该职工信息?删除后的所有信息将无法恢复《Y/N》\n");
scanf("%s",&choice);
if(choice=='y'||choice=='Y')
{
fp=fopen("employ.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&employ[i],sizeof(struct employ),1,fp2)!=0;i++)
{

fwrite(&employ[i],sizeof(struct employ),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
employview();
}
else
{
printf("按任意键返回\n");
getch();
return;
}
}
addemploy()
{
FILE *fp;
char choice='y';
int i=1;
fp=fopen("employ.txt","a+");
while(choice=='y'||choice=='Y')
{
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入职工号码\n");
scanf("%d",&employ[i].employnum);
printf("请你输入职工名\n");
scanf("%s",employ[i].employname);
printf("请输入职工年龄\n");
scanf("%d",&employ[i].employage);
printf("请你输入性别\n");
scanf("%s",employ[i].employsex);
printf("请你输入职工的学历水平\n");
scanf("%s",employ[i].employleve);
printf("请输入职工的工资\n");
scanf("%d",&employ[i].employtage);
fwrite(&employ[i],sizeof(struct employ),1,fp);
printf("是否要输入下个职工信息?\n");
scanf("%s",&choice);
}
printf("按任意键返回\n");
fclose(fp);
getch();
employview();
}
delbook()
{
FILE *fp,*fp2;
int i;
char bookname[10],choice;
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("假如你输入的书名存在,系统自动删除该信息!假如不存在,系统不做任何改动\n");
printf("请输入你要删除的书名:");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{

if(strcmp(bookname,book[i].bookname)!=0)
{
fwrite(&book[i],sizeof(struct book),1,fp2);
}
}
fclose(fp);
fclose(fp2);
window(1,17,79,17);
back(9);
textcolor(3);
printf("是否真的要删除该书籍?删除后该书籍的所有信息将无法恢复《Y/N》\n");
scanf("%s",&choice);
if(choice=='y'||choice=='Y')
{
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{

fwrite(&book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
manageview();
}
else
{
printf("已经取消,按任意键返回\n");
getch();
manageview();
}
}
changebook()
{
FILE *fp,*fp2;
char bookname[10],choice;
int i;
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入要修改的书籍的书字");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{

if(strcmp(book[i].bookname,bookname)==0)
{
window(1,16,79,16);
back(9);
textcolor(3);
printf("你所要修改的书的资料如下,请选择你要修改的内容\n");
printf("序号:〈%d〉 书名:〈%s〉 作者:〈%s〉 \n",book[i].booknum,book[i].bookname,book[i].bookcreat);
window(1,18,79,18);
back(9);
textcolor(3);
printf("1:修改书的序号\n");
printf("2:修改书名\n");
printf("3:修改作者\n");
printf("请输入1-3:");
scanf("%s",&choice);
switch(choice)
{
case '1':
{
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请输入新的序号\n");
scanf("%d",&book[i].booknum);
fwrite(&book[i],sizeof(struct book),1,fp2);
}break;
case '2':
{
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请输入新的书名\n");
scanf("%s",book[i].bookname);
fwrite(&book[i],sizeof(struct book),1,fp2);
}break;
case '3':
{
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请输入新的作者\n");
scanf("%s",book[i].bookcreat);
fwrite(&book[i],sizeof(struct book),1,fp2);
}break;
defaut:break;
}
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{

fwrite(&book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意键返回\n");
getch();
manageview();
}
bookcount()
{
FILE *fp;
int i,n=0;
fp=fopen("book.txt","r");
clrview();
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{

if(book[i].booknum!=0&&strlen(book[i].bookname)!=0&&strlen(book[i].bookcreat)!=0)
{

window(1,15+i,79,15+i);
back(9);
textcolor(3);
printf("第%d本书<序号:%d 书名:%s 作者:%s 状态:%d>",i+1,book[i].booknum,book[i].bookname,book[i].bookcreat,book[i].turefalse);
n=n+1;
}
}
fclose(fp);
window(1,15+n,79,15+n);
back(9);
textcolor(3);
printf("目前共有%d本书",n);
printf("按任意键");
getch();
manageview();
}
findbook()
{
FILE *fp;
char bookname[10];
int ture,i;
fp=fopen("book.txt","r");
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请输入你要查 找的书名");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{

if(strcmp(bookname,book[i].bookname)==0)
{
if(book[i].turefalse==1)
{
window(1,16,79,16);
back(9);
textcolor(3);
printf("这本书的具体资料是:%d %s %s 此书现在无人借阅",book[i].booknum,book[i].bookname,book[i].bookcreat);
getch();
firstview();
}
else
{
window(1,16,79,16);
back(9);
textcolor(3);
printf("这本书已经有人借出");
fclose(fp);
getch();
firstview();
}
fclose(fp);
winset(9,3,1);
return;
}
}
window(1,16,79,16);
back(9);
textcolor(3);
printf("没有你要查询的书籍");
fclose(fp);
getch();
firstview();
}
addbook()
{
FILE *fp;
int i=0;
char choice='y';
fp=fopen("book.txt","a+");
while(choice=='y'||choice=='Y')
{
clrview();
window(1,15,79,15);
back(9);
textcolor(3);
printf("请你输入第%d本书的序号",i+1);
scanf("%d",&book[i].booknum);
window(1,16,79,16);
back(9);
textcolor(3);
printf("请你输入书名");
window(1,17,79,17);
back(9);
textcolor(3);
scanf("%s",book[i].bookname);
window(1,18,79,18);
back(9);
textcolor(3);
printf("请你输入书的作者");
scanf("%s",book[i].bookcreat);
window(1,19,79,19);
back(9);
textcolor(3);
printf("请你设定书的状态,注重(1代表书没借出,新书一般为1,0代表书已经借出");
scanf("%d",&book[i].turefalse);
fwrite(&book[i],sizeof(struct book),1,fp);
window(1,20,79,20);
back(9);
textcolor(3);
printf("是否要输入下本书");
scanf("%s",&choice);
}
fclose(fp);
printf("输入完毕按任意键结束");
getch();
manageview();
}
clrmain()
{
int n;
for(n=1;n<=25;n++)
{
window(1,n,79,n);
back(9);
textcolor(3);
clrscr();
}
window(23,1,63,1);
back(9);
textcolor(3);
cprintf("欢迎进入中文图书馆治理系统");
window(13,2,73,2);
back(9);
textcolor(3);
cprintf("班级:j0111 单位:华中科技大学 QQ:258032791 电话:13554664800");
window(13,3,73,3);
back(9);
textcolor(3);
cprintf("¥¥¥¥¥up down键控制,enter确定 esc退出¥¥¥¥¥¥¥");
}
clrview()
{
int i;
for(i=0;i<=10;i++)
{
window(1,15+i,79,15+i);
back(9);
textcolor(3);
clrscr();
}
}
stuview()
{
int i,m=1;
char ch;
clrmain();
for(i=2;i<=5;i++)
{
winset3(3,9,i);
}
winset3(3,9,1);
while(1)
{
ch=getch();
if(ch==27) break;
if(ch==13)
{switch(m)
{case 1: addcar();break;
case 2: delcar();break;
case 3:carcount();break;
case 4:lendcount();break;
case 5: manageview();return;
}
}
if (ch==0)
{ch=getch();
if(ch==72)
if(m>1)
{winset3(3,9,m);
m--;
winset3(9,3,m);
}
if(ch==80)
if(m<5)
{winset3(3,9,m);
m++;
winset3(9,3,m);
}}
}
}
employview()
{
int i,m=1;
char ch;
clrmain();
for(i=2;i<=5;i++)
{
winset2(3,9,i);
}
winset2(3,9,1);
while(1)
{
ch=getch();
if(ch==27) break;
if(ch==13)
{switch(m)
{case 1: addemploy();break;
case 2: changemploy();break;
case 3:delemploy();break;
case 4:employcount();break;
case 5: manageview();break;
}
}
if (ch==0)
{ch=getch();
if(ch==72)
if(m>1)
{winset2(3,9,m);
m--;
winset2(9,3,m);
}
if(ch==80)
if(m<5)
{winset2(3,9,m);
m++;
winset2(9,3,m);
}}
}
}
manageview()
{
int i,m=1;
char ch;
clrmain();
for(i=2;i<=7;i++)
{
winset1(3,9,i);
}
winset1(3,9,1);
while(1)
{
ch=getch();
if(ch==27) break;
if(ch==13)
{switch(m)
{case 1: addbook();break;
case 2: changebook();break;
case 3:delbook();break;
case 4:bookcount();break;
case 5: employview();break;
case 6: stuview();break;
case 7: firstview();break;
}
}
if (ch==0)
{ch=getch();
if(ch==72)
if(m>1)
{winset1(3,9,m);
m--;
winset1(9,3,m);
}
if(ch==80)
if(m<7)
{winset1(3,9,m);
m++;
winset1(9,3,m);
}}
}
}
firstview()
{
int i,n=1;
char ch;
clrmain();
for(i=2;i<=5;i++)
{
winset(3,9,i);
}
winset(9,3,1);
while(1)
{

ch=getch();
if(ch==27) break;
if(ch==13)
{switch(n)
{case 1: findbook();break;
case 2: lendbook();break;
case 3:winset(3,9,3);manageview();break;
case 4:huanbook();break;
case 5:  exit(0);break;
}
}
if (ch==0)
{ch=getch();
if(ch==72)
if(n>1)
{winset(3,9,n);
n--;
winset(9,3,n);
}
if(ch==80)
if(n<5)
{winset(3,9,n);
n++;
winset(9,3,n);
}}
}
}
main()
{
clrmain();
firstview();
}

视频教程列表
文章教程搜索
 
C语言程序设计推荐教程
C语言程序设计热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058