部分乱码 图书管理系统
#include<stdio.h>#include<cstdlib>
#include<stdlib.h>
#include<string.h>
struct book
{
char name[20]; //书名
char writer[10]; //作者
char num[10]; //书号
char press[8]; //出版社
char outtime[25]; //出版日期
char price[3]; //图书价格
}book[50]={{"大学计算机基础","陈建勋","000001","高等教育出版","20050206","30"},
{"语言大学","黄远林","000002","电子工业出版","20040306","25"},
{"计算机网络技术","宋文官","000003","中国铁道出版","20100606","28"},
{"数据库系统概术","萨师煊","000004","高等教育出版","20010708","40"},
{"计算机组成原理","白中英","000005","科学出版社","20080601","25"},
{"数据结构","刘大友","000006","清华大学出版","20090106","30"}};
char note[2]={"wu"};
void main()
{
void message();
char i;
for(i=6;i<50;i++)
strcpy(book[6].name,note);
message();
}
void message()
{
int i,k;
if(book[1].name=='\0')
{
printf("没有图书信息,是否添加");
printf("input 1 (添加)or 其他数字(退出菜单)");
scanf("%d",&k);
if(k==1)
printf("dsklf"); //跳到添加菜单
if(k!=1)
printf("skdj"); //跳到主菜单
}
else
{
for(i=0;strcmp(book[i].name,note)!=0;i++)
printf("书名:%s 作者:%s 书号:%s 出版社:%s 出版日期:%d 单价:%d\n",book[i].name,book[i].writer,book[i].num,book[i].press,book[i].outtime,book[i].price);
}
system("pause");
}