这里写自定义目录标题
#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