#include<stdio.h> int sear(int a[],int n,int find) { int i; for(i=0; i<n; i++) if(a[i]==find) return i; return -1; } #define N 4 int main() { int a[N]={1,3,5,209}; int b; int find; scanf("%d", &find); b=sear(a,N,find); if(b>=0) printf("%d", b); else printf("没有找到"); }
顺序查找
猜你喜欢
转载自blog.csdn.net/acmer6s/article/details/80315376
今日推荐
周排行