# 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; (; I <n; I ++) {If (ARR [I]. key = Key) return I; printf ("check % d \ n", arr [I]);} return-1 ;}// better, there is only one judgment in the for loop. Note that data cannot cross-border int find_seq_improved (struct elemtype arr [], int N, keytype key) {int I = 0; arr [N]. key = key; // set the record for (; I ++) {If (ARR [I]. key = Key) break; printf ("check % d \ n", arr [I]);} if (I <n) return I; else return-1 ;} int main () {struct elemtype arr [10]; arr [0]. key = 0; arr [1]. key = 11; arr [2]. key = 22; arr [3]. key = 33; arr [4]. key = 44; arr [5]. key = 55; int idx = find_seq (ARR, 6,554); printf ("idx = % d \ n", idx); int idx1 = find_seq_improved (ARR, 6,554 ); printf ("idx = % d \ n", idx1); Return 0 ;}