下载此文档

C语言课程设计设备管理系统.doc


文档分类:IT计算机 | 页数:约9页 举报非法文档有奖
1/9
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/9 下载此文档
文档列表 文档介绍
: .
< s t d i o
puts("
*欢迎使用设备管理系统! *");
#i nclude <>
#in elude vconi > #in elude <stri > void menu();〃功能选择 void lkp();〃查看信息 void chng();〃修改信息 void dlt();〃删除信息 void add();〃添加信息 void read();〃读取文件 void write();〃 写入文件 void count();〃 统计信息 struct dvc {
char dno [20],d name[20],dow ner[20],ddpartme nt[20],damou nt[20],dtime[20],dprice[20];
int dlt;
} d[200]; int tot,sum; int mai n()
system("color fc");
system("mode con cols=146 lin es=40");
);
puts("
puts(" ************************"
read();〃将保存至外存中的文件读进内存
men u(); //用户功能选择
write(); //将内存里的所有信息覆写回外存文件中
system("cls");
puts("感谢您的使用");
return 0;
}
void read() {
tot=0;
FILE *fp=fope n("D:\\i ","r");
if(fp==NULL)
{
fp=fope n( "D:\\i ","w"); fclose(fp);
}
while (fsca nf(fp," %s %s %s %s %s %s %s",d[tot].d no,d[tot].d name,d[tot].dow ner,d[tot].ddpartme nt,d[tot].damou nt,d[tot].dti me,d[tot].dprice)!=EOF)
d[tot++].dlt=0;
} fclose(fp);
}
void write()
{
int i;
FILE *fp=fope n( "D:\\i ","w"); for (i=0;i<tot;i++) if (!d[i].dlt)
fprin tf(fp,"%s %s %s %s %s %s %s\n",d[i].d no ,d[i].d name,d[i].dow ner,d[i].ddpartme nt,d[i].damou nt,d[i].dtime,d[i].dpr ice);
fclose(fp);
}
void men u()
{
char a;
while (1)
{
puts(" ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★请选择需要的功能:★★ ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ ");
puts(

C语言课程设计设备管理系统 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息