if语句放在for里为什么不行?
#include<stdio.h>int find(int array[],int start,int finish,int whattofind) {
enum{NOT_FIND,FIND};
int result=NOT_FIND;
int i;
for(i=start;i<finish&&array[i]==whattofind;i++)
{
// if(array[i]==whattofind){
result=FIND;
break;
//}
}
return result;
}
void distinct(int a[],int size){
int i;
printf("%d\n",a[0]);
for(i=1;i<size;i++)
{
if(!find(a,0,i-1,a[i]))
printf("%d\n",a[i]);
}
}
int main(){
int a[]={0,9,10,34,89,99,9};
printf("%d\n",find(a,0,6,9));
// distinct(a,7);
while(1);
}