主题:那位高手帮忙看一下行不
#include<stdio.h>
void main()
{ void search(char *name[],char b[]);
void detele(char *name[],char c[]);
char *name[]={"i am a student","i love china!","i like fun"};
char b[20]="i am a student";
char c[20]="i am a student";
search(name,b);
printf("after the delete is:");
detele(name,c);
}
void search(char *name[],char b[])
{ int i,j=0;
for(i=0;i<3;i++)
{ if(strcmp(name[i],b)==0) j=j+1;}
printf("the line %d\n",j );
}
void detele(char *name,char c[])
{int i,j=0;/这里杂错了啊
for(i=0;i<3;i++)
if(strcmp(name[i],c)==0) j=j+1;
printf("the line %d\n",j);
}
void main()
{ void search(char *name[],char b[]);
void detele(char *name[],char c[]);
char *name[]={"i am a student","i love china!","i like fun"};
char b[20]="i am a student";
char c[20]="i am a student";
search(name,b);
printf("after the delete is:");
detele(name,c);
}
void search(char *name[],char b[])
{ int i,j=0;
for(i=0;i<3;i++)
{ if(strcmp(name[i],b)==0) j=j+1;}
printf("the line %d\n",j );
}
void detele(char *name,char c[])
{int i,j=0;/这里杂错了啊
for(i=0;i<3;i++)
if(strcmp(name[i],c)==0) j=j+1;
printf("the line %d\n",j);
}