代码拉取完成,页面将自动刷新
#include <stdio.h>
extern float *search(float *score, int A, int B, int k);
int main()
{
// 三个学生, 每位学生4门课程
float score[3][4]={{60,70,80,90},
{56,89,67,88},{34,78,90,66}};
float *p; int i,k;
scanf("%d", &k);
printf("The scores of No.%d are:\n",k);
// 调用函数获取返回值
p = search((float*)score, 3, 4, k);
for(i = 0;i < 4; i++)
printf("%5.2f\t",*(p + i));
printf("\n");
return 0;
}
float *search(float *score, int A, int B, int k)
{
int offset = k * B;
float *pt = score + offset;
return pt;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。