PAT训练(乙级)—— 1004. 成绩排名 (20)
2017-12-24 21:43
309 查看
C语言实现
#include<stdio.h> struct student{ char name[11]; char num[11]; int grade; }; int main(void) { int n,i; int min,max; int x,y; scanf("%d",&n); struct student stu ; for(i=0;i<n;i++){ scanf("%s %s %d",stu[i].name,stu[i].num,&stu[i].grade); } min=101;max=-1; for(i=0;i<n;i++){ if(stu[i].grade>max){ max=stu[i].grade; x=i; } if(stu[i].grade<min){ min=stu[i].grade; y=i; } } printf("%s %s\n",stu[x].name,stu[x].num); printf("%s %s",stu[y].name,stu[y].num); }
相关文章推荐
- pat 乙级 1004 成绩排名(20)
- PAT乙级.1004. 成绩排名 (20)
- [PAT乙级]1004. 成绩排名 (20)
- PAT乙级1004. 成绩排名 (20)------结构体
- 【PAT】(乙级)1004. 成绩排名 (20)
- PAT乙级1004. 成绩排名 (20)
- PAT乙级 1004. 成绩排名 (20)
- PAT乙级1004. 成绩排名 (20)
- PAT乙级 1004. 成绩排名 (20)
- 浙江大学PAT乙级试题.1004. 成绩排名 (20)C语言
- PAT乙级1004. 成绩排名 (20)
- PAT乙级 1004. 成绩排名 (20)
- 1004. 成绩排名 (20)-PAT乙级真题
- PAT-乙级 1004.成绩排名(20)
- PAT乙级—1004. 成绩排名 (20)-native
- 1004. 成绩排名 (20) PAT乙级真题
- 1004. 成绩排名 (20)-浙大PAT乙级真题java实现
- 1004. 成绩排名 (20)--PAT乙级
- 浙大PAT乙级1004. 成绩排名 (20)
- PAT乙级1004. 成绩排名 (20)