AI智能整理导入 AI智能整理导入
×
首页 题库中心 c语言程序设计题库 题目详情
CA85E835B92000012B50FB49F93816B5
c语言程序设计题库
1,073
单选题

下面的程序输入4名学生的学号、姓名和成绩,然后输出成绩最高的学生的学号、姓名和成绩。将程序补充完整。
#include "stdio.h"


main()
{
struct student
{
int id;
char name[20];
float score;
};
struct student stu[4];
_____【1】_____________;
int i,temp=0;
float max;
for(i=0;i<4;i++)
scanf("%d%s%f",____【2】_________,&stu[i].name,&stu[i].score);
for(max=stu[0].score,i=1;i<4;i++)
if(____【3】_________)
{max=stu[i].score;temp=i;}
____【4】_________;
printf("\nThe maximum score:\n");
printf("No.:%d\nname:%s\nscore:%4.1f\n",p->id,p->name,p->score);
}

A
struct student *p
B
&stu[i].id
C
stu[i].score>max
D
p=stu+temp

答案解析

正确答案:ABCD

解析:

结构体与共用体
c语言程序设计题库

扫码进入小程序
随时随地练习

关闭
专为自学备考人员打造
试题通
自助导入本地题库
试题通
多种刷题考试模式
试题通
本地离线答题搜题
试题通
扫码考试方便快捷
试题通
海量试题每日更新
试题通
欢迎登录试题通
可以使用以下方式扫码登陆
试题通
使用APP登录
试题通
使用微信登录
xiaochengxu
联系电话:
400-660-3606
xiaochengxu