📄 ex5-6.c
字号:
#include <stdio.h>
main() {
struct mepoint {
unsigned char num;
unsigned char name[11];
float score;
} mp[4]={
{1, "1stpoint", 368.78},
{2, "2ndpoint", 134.90},
{3, "3tdpoint", 798.90},
{4, "4thpoint", 436.01}
};
struct mepoint *p;
unsigned char i,temp=0;
float max;
for (max=mp[0].score, i=1;i<4;i++)
if (mp[i].score>max) {
max=mp[i].score; temp=i;
}
p=mp+temp;
printf("\nThe maxmum score: \n");
printf("No.: %bd\nname: %s\nscore: %4.2f\n",
p->num,p->name,p->score);
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -