Compare commits
2 Commits
329b29d71d
...
fe0a344606
Author | SHA1 | Date |
---|---|---|
fei liang rong | fe0a344606 | 2 years ago |
fei liang rong | c5f9fbf490 | 2 years ago |
@ -0,0 +1,23 @@
|
||||
// 查询图书信息
|
||||
void query_data()
|
||||
{
|
||||
int id;
|
||||
struct book *p;
|
||||
|
||||
printf("请输入要查询的图书编号:");
|
||||
scanf("%d", &id);
|
||||
|
||||
p = find(id); // 查找编号为id的图书
|
||||
if(p != NULL)
|
||||
{
|
||||
printf("图书信息如下:\n");
|
||||
printf("图书编号:%d\n", p->id);
|
||||
printf("图书名称:%s\n", p->name);
|
||||
printf("图书作者:%s\n", p->author);
|
||||
printf("图书价格:%.2f\n", p->price);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("没有找到编号为%d的图书!\n", id);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue