# include & ltstdio.h & gt
#定義?n?三
結構?學生
{
int?號碼;
夏爾。名稱【20】;
浮空?得分【3】;
};
學生*?max(struct?學生?*p)
{?
int?i=0,j = 0;
浮空?max _ score = 0;
max _ score = p-& gt;得分【0】;
為了什麽?(?I = 0;?我& ltn;?i++)
{
為了什麽?(?j = 0;?j & lt3;?j++?)
{
如果?(p-》;score【j】& gt;max_score)
{
max _ score = p-& gt;score【j】;
}
}
p++;
}
回歸?p;
}
int?主()
{
學生?stu【N】,* p = NULL
int?i=0,j = 0;
為了什麽?(?I = 0;?我& ltn;?i++)
{
Printf(“請輸入%d學生的基本信息:\n“,I+1);
Printf(“學號:“);
scanf(“% d“,& amp斯圖【我】。數量);
printf(“name“);
scanf(“% s“,& amp斯圖【我】。姓名);
Printf(“三門科目(例如:100?90?80):");
對於(?j = 0;?j & lt3;?j++?)
scanf(“% f“,& amp斯圖【我】。score【j】);
}
p = stu
p = max(p);
-p;
Printf(“最高分學生的姓名:%s\n“,p-& gt;姓名);
Printf(“分數最高的學生ID:% d“,p-& gt;數量);
回歸?0;
}
試驗結果