C语言问题 急~~~~~~~~~~~~~~~~~~~~~

来源:百度知道 编辑:UC知道 时间:2024/05/16 02:37:17
这是一个学生管理系统:不知道哪有问提???请各位大哥大姐帮帮忙~
#include<stdio.h>
struct student
{
int no; //学号
char name[15]; //姓名
int score[3]; //三门成绩
double avr; //平均成绩
};
struct student stu[50]; //声明一个结构数组变量
struct student input();
void display (struct student stu[],int count);
void sort (struct student stu[],int count);
void insert (struct student stu[],int count);
void del (struct student stu[],int count);

void main()
{
int count;
char ch;
ch='y';
printf("请输入学员的信息: ");
printf("\n");
count=0;
while((ch=='y')||(ch=='Y'))
{
stu[count]=input(); //调用录用信息函数
count++;
printf("\n是否继续?(y or n)");
scanf("%c",&ch);
}
printf("\n排序前的信息: ");
display(stu,count); //调用显示函数
sort(stu,count); //调用排序函数
printf(&q

我给你改了改在我机器上运行没有问题,你拷过去看一下
我用的是vc++编译的。
#include<stdio.h>
struct student
{
int no; //学号
char name[15]; //姓名
int score[3]; //三门成绩
double avr; //平均成绩
};

struct student stu[50];//声明一个结构数组变量
int count=-1;

struct student input();
void display();
void sort();
void insert();
void del();

void main()
{
char ch='y';
count=0;
printf("请输入学员的信息:\n");
while((ch=='y')||(ch=='Y'))
{
stu[count++]=input(); //调用录用信息函数
printf("\n是否继续?(y or n)");
fflush(stdin);
scanf("%c",&ch);
}

printf("\n排序前的信息: ");
display(); //调用显示函数
sort(); //调用排序函数
printf("\n排序后的信息: ");
display();

printf("是否要插入新学员(y or n)");
fflush(stdin);
scanf("%c",&ch);