- 博客(3)
- 收藏
- 关注
原创 输入一个正整数n,再输入n个学生的姓名和百分制成绩,在子函数将其转换为五级制成绩后在主函数中输出学生信息。要求:定义和调用函数set_grade(stu, n),其功能是根据结构体数组stu中存放的
#include<stdio.h>struct student{ char name[10]; int score; char grade; }a[50];void set_grade(struct student *p,int m){ int i; for(i=0;i<m;i++) { if((*(p+i)).score>=90) (*(p+i)).grade
2022-12-18 17:14:18 1176 1
原创 输入5位同学的一组信息,包括学号、姓名、数学成绩、计算机成绩,求得每位同学的平均分和总分,然后按照总分从高到低排序,排序用函数实现。
#include<stdio.h>struct student{ int num; char name[10]; float math; float cp; float sum; float aver; }a[5]={};void max(struct student *p,int n){ int i,j; struct student t; for(i=0;
2022-12-18 17:05:16 1335 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人