如何把這個數
#include<stdio.h>#define MAX_NUM 100
void main()
{
struct grade
{
char name[20];
int yuyan;
};
typedef struct grade node;
node student[10];
int i,a;
int num;
float stu_ave;
const int stu_num = 10;
float score[MAX_NUM];
char degree[][10] = {"不及格", "及格", "中等", "良好", "优秀"};
int statistics[5] = {0};
int distribution[11] = {0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4};
float sum = 0.0;
printf("★★★★★★★★★欢迎进入学生单科成绩管理系统★★★★★★★★★\n\n");
printf("请输入学生人数.(小于10) ==> ");
scanf("%d",&num);
i=0;
while(i<num)
{
printf("学生编号: %d\n",i + 1);
printf("请输入学生姓名. ==> ");
scanf("%s",&student[i].name[i]);
printf("请输入C语言成绩. ==> ");
scanf("%d",&student[i].yuyan);
++i;
}
for (i = 0; i < num; i++)
{
sum += student[i].yuyan;
}
printf("\n平均分:%.2f\n\n", sum / num);
for (i = 0; i < num; i++)
statistics[distribution[(int)(student[i].yuyan / 10)]]++;
printf("等级统计:\n");
for (i = 0; i < 5; i++)
printf("%s:\t%d人\t%.1f%%\n", degree[i], statistics[i], 100 * (float)statistics[i]/num);
}