main()
{ int a[100];
int * p = a;/磨雀做/p指岁脊向瞎衡数组a的地址 //
int k,i = 0; //k为要查询的数,i为下标//
scanf("%d",&k);
for (; i < 100&&(*p != k);i++,p++)
;
if (i = 100)
printf("No find !\n");
else
printf("%d\n",i); //输出下标//
}
int a[100] = {......};//定义数喊橡祖
void main(void)
{
int * p = a;//郑逗旁查询用指针
int k = 5; //指信要查找的数字
int i = 0;
for (; i < 100&&(*p != k);i++,p++)
;
if (i = 100)
printf("No find !\n");
else
printf("%d\n",i);
}