怎么了?
#include<stdio.h>int search(int list,int n,int x);
int main(void)
{
int n,x,i,index,a[10],b,list;
printf("Input n:");
scanf("%d",&n);
printf("Input %d integers:",n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Input x:");
scanf("%d",&x);
b=search(list,n,x);
if(b!=-1)
printf("index=%d",index);
if(b=-1)
printf("NO FOUND");
return 0;
}
int search(int list,int n,int x)
{
int i,a[10],index;
for(i=0;i<n;i++)
if(x==a[i])
index=i;
else
index=-1;
return index;
}