#include <stdio.h>#include <stdlib.h>typedef int KeyType;struct ElemType{ int key;};int find_seq(struct ElemType arr[],int n,KeyType key){ int i=0; for(;i<n;i++){ if(arr[i].key==key)return i; printf("check %d\n",arr[i]); } return -1;}//较好的提高,for循环里只有一个判断,注意数据不能越界int find... Read More
posted @ 2011-10-10 21:08 庚武 Views(298) Comments(0) Diggs(0)