求解答find函数怎么修改(链表内容)

这里写自定义目录标题

#find函数怎么改呀,运行不对,求大神帮忙
Status find(LinkList &L)
{
LinkList p=L->next,q=L->next;
int num;
int count;
char s[50];
cin>>num;
for(int i=0;i<num;i++)
cin>>s;
while(num–)
{
count=0;
p=L->next;
while§
{
if(strcmp(p->data.name, s)==0)
{
q=p;
count++;
}
p=p->next;
}
if(count)
{
cout<<count<<endl;
for(int i=0;i<num;i++)
cout<data.no<<" “<data.name<<” "<<fixed<<setprecision(2)<data.price<<endl;
}
else
cout<<“没有找到!”<<endl;
}
return OK;
}`

正确运行:
6
9787302257646 程序设计基础 25.00
9787302164340 程序设计基础(第2版) 20.00
9787302219972 单片机技术及应用 32.00
9787302203513 单片机原理与应用技术 26.00
9787810827430 工业计算机控制技术——原理与应用 29.00
9787811234923 汇编语言程序设计教程 21.00
2
数据结构
程序设计基础
样例输出

没有找到!
1
9787302257646 程序设计基础 25.00
我的运行结果:
1
9787302257646 程序设计基础 25.00
1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值