未分类题
以下程序的功能是:借助指针变量找出数组元素中的最大值及其元素的下标值。请填空。 #include <stdio.h> main() { int a[10],*p,*s; for(p=a;p-a<10;p++) scanf("%d",p); for(p="a,s=a;p-a<10;p++)" if(*p>*s) s= ; printf(“index=%d/n”,s-a); }
A.h>
【参考答案】
A. `p` 解析:在第二个`for`循环中,我们需要更新指针`s`以指向当前找到的最大值。如果当前指针`p`指向的值......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)