haha1235  
#include <stdio.h>
int main(void)
{
  int i,flag,x;
  int a[5];
  printf("Enter 5 integers:");
  for(i=0;i<5;i++)
  scanf_s("%d",&a[i]);
  printf("Enter x:");
  scanf_s("%d",&x);
  flag=0;
  for(i=0;i<5;i++)
  if(a[i]==x){
    printf("Index is %d\n",i);
    flag=1;
    break;
  }
  if(flag==0)
  printf("Not Found\n");
  return 0;
  }

posted on 2013-10-07 12:03  haha1235  阅读(131)  评论(0编辑  收藏  举报