高等继续教育 / 高级语言程序设计
正确率:郑大成教%
下列程序段的输出结果为()。
typedef struct {
int score;
char name[20];
} Student;
int main() {
Student students[3] = {{{90, "Alice"}, {85, "Bob"}}, {78, "Charlie"}};
int maxIndex = 0;
for (int i = 1; i < 3; i++) {
if (students[i].score > students[maxIndex].score) {
maxIndex = i;
}
}
printf("%s\n", students[maxIndex].name);
return 0;
}
编译错误,数组初始化格式不正确
Bob
Charlie
Alice
参考答案:
佳题速递: