学生成绩管理系统 c语言
【问题描述】用c语言编写一个简单的学生信息管理程序,能实现对学生信息的简单管理。【具体要求】建立一个4个学生的信息登记表,每个学生的信息包括:学号,姓名,和3门课程的成绩...
【问题描述】
用c语言编写一个简单的学生信息管理程序,能实现对学生信息的简单管理。
【具体要求】
建立一个4个学生的信息登记表,每个学生的信息包括:学号,姓名,和3门课程的成绩(FOX,C,ENGLISH)。
程序运行时显示一个简单的菜单,例如:
(1):信息输入(INPUT)
(2):总分统计(COUNT)
(3):总分排序(SORT)
(4):查询(QUERY)
其中:
(1):对4个学生的信息进行输入;
(2):对每个学生的3门课程统计总分;
(3):对4个学生的总分按降序排序并显示出来;
(4):查询输入一个学号后,显示出该学生的有关信息;
可以用visaul C++ 6.0运行的 展开
用c语言编写一个简单的学生信息管理程序,能实现对学生信息的简单管理。
【具体要求】
建立一个4个学生的信息登记表,每个学生的信息包括:学号,姓名,和3门课程的成绩(FOX,C,ENGLISH)。
程序运行时显示一个简单的菜单,例如:
(1):信息输入(INPUT)
(2):总分统计(COUNT)
(3):总分排序(SORT)
(4):查询(QUERY)
其中:
(1):对4个学生的信息进行输入;
(2):对每个学生的3门课程统计总分;
(3):对4个学生的总分按降序排序并显示出来;
(4):查询输入一个学号后,显示出该学生的有关信息;
可以用visaul C++ 6.0运行的 展开
展开全部
经达Turbo C++测试的:
#include <stdio.h>
#define STUDEN_TOTAL 3
void CopyString(char *dst,char *src,int length)
{
int i;
for(i=0; i<length; i++)
{
dst[i] = src[i];
}
}
void main()
{
struct studen_S
{
int no;
char name[20];
int record_fox;
int record_c;
int record_en;
int record_total;
}studen[STUDEN_TOTAL],stu_temp;
int item;
int i,j;
int studen_count=0;
while(1)
{
printf("\n");
printf("1: Input the records of studen\n");
printf("2: Count the records of studen\n");
printf("3: Sort the records of studen\n");
printf("4: Query the information of studens\n");
printf("0: exit\n");
printf("Please input a nunber select the itme:");
scanf("%d",&item);
if(item == 0)
break;
printf("\n");
switch(item)
{
case 1:
if(studen_count >= STUDEN_TOTAL)
printf("The count of studens is full!\n");
else
{
printf("Plese input the information of studen:[no] [name] [fox] [c] [en]\n");
for(i=studen_count; i<STUDEN_TOTAL; i++)
{
scanf("%d %s %d %d %d",&studen[i].no,&studen[i].name,&studen[i].record_fox,&studen[i].record_c,&studen[i].record_en);
studen_count ++;
}
}
break;
case 2:
if(studen_count == 0)
printf("The information of studens is empty!\n");
else
{
printf("Count the total record of studens...\n");
for(i=0; i<studen_count; i++)
{
studen[i].record_total = studen[i].record_fox + studen[i].record_c + studen[i].record_en;
printf("%-19s's total record is: %d\n",studen[i].name,studen[i].record_total);
}
}
break;
case 3:
printf("Sort the total record of studens...\n");
for(i=0; i<studen_count-1; i++)
{
for(j=i; j<studen_count; j++)
{
if(studen[i].record_total < studen[j].record_total)
{
stu_temp.no = studen[i].no;
//stu_temp.name[0] = studen[i].name[0];
CopyString(stu_temp.name,studen[i].name,20);
stu_temp.record_fox = studen[i].record_fox;
stu_temp.record_c = studen[i].record_c;
stu_temp.record_en = studen[i].record_en;
stu_temp.record_total = studen[i].record_total;
studen[i].no = studen[j].no;
CopyString(studen[i].name,studen[j].name,20);
studen[i].record_fox = studen[j].record_fox;
studen[i].record_c = studen[j].record_c;
studen[i].record_en = studen[j].record_en;
studen[i].record_total = studen[j].record_total;
studen[j].no = stu_temp.no;
CopyString(studen[j].name,stu_temp.name,20);
studen[j].record_fox = stu_temp.record_fox;
studen[j].record_c = stu_temp.record_c;
studen[j].record_en = stu_temp.record_en;
studen[j].record_total = stu_temp.record_total;
}
}
}
printf("Number Name Fox C Englis Total\n");
for(i=0; i<studen_count; i++)
{
printf("%-7d%-10s%-6d%-6d%-6d%-6d\n",studen[i].no,studen[i].name,studen[i].record_fox,studen[i].record_c,studen[i].record_en,studen[i].record_total);
}
break;
case 4:
printf("Please input the number of studen: ");
scanf("%d",&j);
for(i=0; i<studen_count; i++)
{
if(studen[i].no == j)
break;
}
printf("Number: %d\n",studen[i].no);
printf("Name : %s\n",studen[i].name);
printf("Fox : %d\n",studen[i].record_fox);
printf("C : %d\n",studen[i].record_c);
printf("Englis: %d\n",studen[i].record_en);
printf("Total : %d\n",studen[i].record_total);
break;
default:
break;
}
}
}
#include <stdio.h>
#define STUDEN_TOTAL 3
void CopyString(char *dst,char *src,int length)
{
int i;
for(i=0; i<length; i++)
{
dst[i] = src[i];
}
}
void main()
{
struct studen_S
{
int no;
char name[20];
int record_fox;
int record_c;
int record_en;
int record_total;
}studen[STUDEN_TOTAL],stu_temp;
int item;
int i,j;
int studen_count=0;
while(1)
{
printf("\n");
printf("1: Input the records of studen\n");
printf("2: Count the records of studen\n");
printf("3: Sort the records of studen\n");
printf("4: Query the information of studens\n");
printf("0: exit\n");
printf("Please input a nunber select the itme:");
scanf("%d",&item);
if(item == 0)
break;
printf("\n");
switch(item)
{
case 1:
if(studen_count >= STUDEN_TOTAL)
printf("The count of studens is full!\n");
else
{
printf("Plese input the information of studen:[no] [name] [fox] [c] [en]\n");
for(i=studen_count; i<STUDEN_TOTAL; i++)
{
scanf("%d %s %d %d %d",&studen[i].no,&studen[i].name,&studen[i].record_fox,&studen[i].record_c,&studen[i].record_en);
studen_count ++;
}
}
break;
case 2:
if(studen_count == 0)
printf("The information of studens is empty!\n");
else
{
printf("Count the total record of studens...\n");
for(i=0; i<studen_count; i++)
{
studen[i].record_total = studen[i].record_fox + studen[i].record_c + studen[i].record_en;
printf("%-19s's total record is: %d\n",studen[i].name,studen[i].record_total);
}
}
break;
case 3:
printf("Sort the total record of studens...\n");
for(i=0; i<studen_count-1; i++)
{
for(j=i; j<studen_count; j++)
{
if(studen[i].record_total < studen[j].record_total)
{
stu_temp.no = studen[i].no;
//stu_temp.name[0] = studen[i].name[0];
CopyString(stu_temp.name,studen[i].name,20);
stu_temp.record_fox = studen[i].record_fox;
stu_temp.record_c = studen[i].record_c;
stu_temp.record_en = studen[i].record_en;
stu_temp.record_total = studen[i].record_total;
studen[i].no = studen[j].no;
CopyString(studen[i].name,studen[j].name,20);
studen[i].record_fox = studen[j].record_fox;
studen[i].record_c = studen[j].record_c;
studen[i].record_en = studen[j].record_en;
studen[i].record_total = studen[j].record_total;
studen[j].no = stu_temp.no;
CopyString(studen[j].name,stu_temp.name,20);
studen[j].record_fox = stu_temp.record_fox;
studen[j].record_c = stu_temp.record_c;
studen[j].record_en = stu_temp.record_en;
studen[j].record_total = stu_temp.record_total;
}
}
}
printf("Number Name Fox C Englis Total\n");
for(i=0; i<studen_count; i++)
{
printf("%-7d%-10s%-6d%-6d%-6d%-6d\n",studen[i].no,studen[i].name,studen[i].record_fox,studen[i].record_c,studen[i].record_en,studen[i].record_total);
}
break;
case 4:
printf("Please input the number of studen: ");
scanf("%d",&j);
for(i=0; i<studen_count; i++)
{
if(studen[i].no == j)
break;
}
printf("Number: %d\n",studen[i].no);
printf("Name : %s\n",studen[i].name);
printf("Fox : %d\n",studen[i].record_fox);
printf("C : %d\n",studen[i].record_c);
printf("Englis: %d\n",studen[i].record_en);
printf("Total : %d\n",studen[i].record_total);
break;
default:
break;
}
}
}
展开全部
这个问题 只能用链表或者文件来实现
#include<iostream>
#include<cstring>
#include<malloc.h>
using namespace std;
struct lx
{
long num;
char name[20];
struct lx *link;
};
struct lx *addlist(struct lx *head,long x);//添加节点;
void listclear(struct lx *head);
struct lx *createlist(void );
void listprintf(struct lx *p);
int main(int argc,char **argv)
{
long x;
struct lx *p = createlist();
listprintf(p);
cout<<"输入学号"<<endl;
cin>> x;
struct lx *head = addlist(p,x);
listprintf(head);
listclear(head);
//listprintf(temp);
return 0;
}
struct lx *createlist(void )
{
struct lx *head ;
struct lx *tail ;
struct lx *p;
char buf[20];
head = NULL;
p = (struct lx *)malloc(sizeof (struct lx));
// cout<< "内存分配失败!!!!"<< endl;
cout<< "请输入学号:";
cin>> p->num;
cout<< "请输入姓名:";
cin>> p->name;
//cout<<buf<<endl;
//strcpy(p->name, buf);
while(1)
{
if(head == NULL)
{
head = p;
tail = p;
}
else
{
tail->link = p;
tail = p;
}
p = (struct lx*)malloc(sizeof(struct lx));
// cout<<"内存分配失败!!!!!"<< endl;
cout<< "请输入学号:";
cin>> p->num;
if(p->num == 0)
break;
cout<< "请输入姓名:";
cin>> p->name;
//strcpy(p->name,buf);
}
tail->link = NULL;
return head;
}
void listprintf(struct lx *p)
{
struct lx* q = p;
while(q!= NULL)
{
cout<< q->num<<endl;
cout<< q->name<<endl;
q = q->link;
}
}
struct lx *addlist(struct lx *head,long x)//添加节点
{
struct lx *p = head;
struct lx *q,*temp,*temp1;
q = NULL;
if(p->link == NULL )
{
if((p->num ) > x )
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
q->link = p;
p = q;
}
else
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
temp1 = p->link;
p->link = q;
q->link = temp1;
temp1->link = NULL;
}
}
else if(((p->num) > x)&&((p->link)->link == NULL))
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
p->link = q;
q->link = p;
q->link = NULL;
}
else
{
while(1)
{
if((p->num < x)&&((p->link)->num > x))
break;
p = p->link;
}
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
temp = p->link;
p->link = q;
q->link = temp;
}
return p;
}
void listclear(str
#include<iostream>
#include<cstring>
#include<malloc.h>
using namespace std;
struct lx
{
long num;
char name[20];
struct lx *link;
};
struct lx *addlist(struct lx *head,long x);//添加节点;
void listclear(struct lx *head);
struct lx *createlist(void );
void listprintf(struct lx *p);
int main(int argc,char **argv)
{
long x;
struct lx *p = createlist();
listprintf(p);
cout<<"输入学号"<<endl;
cin>> x;
struct lx *head = addlist(p,x);
listprintf(head);
listclear(head);
//listprintf(temp);
return 0;
}
struct lx *createlist(void )
{
struct lx *head ;
struct lx *tail ;
struct lx *p;
char buf[20];
head = NULL;
p = (struct lx *)malloc(sizeof (struct lx));
// cout<< "内存分配失败!!!!"<< endl;
cout<< "请输入学号:";
cin>> p->num;
cout<< "请输入姓名:";
cin>> p->name;
//cout<<buf<<endl;
//strcpy(p->name, buf);
while(1)
{
if(head == NULL)
{
head = p;
tail = p;
}
else
{
tail->link = p;
tail = p;
}
p = (struct lx*)malloc(sizeof(struct lx));
// cout<<"内存分配失败!!!!!"<< endl;
cout<< "请输入学号:";
cin>> p->num;
if(p->num == 0)
break;
cout<< "请输入姓名:";
cin>> p->name;
//strcpy(p->name,buf);
}
tail->link = NULL;
return head;
}
void listprintf(struct lx *p)
{
struct lx* q = p;
while(q!= NULL)
{
cout<< q->num<<endl;
cout<< q->name<<endl;
q = q->link;
}
}
struct lx *addlist(struct lx *head,long x)//添加节点
{
struct lx *p = head;
struct lx *q,*temp,*temp1;
q = NULL;
if(p->link == NULL )
{
if((p->num ) > x )
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
q->link = p;
p = q;
}
else
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
temp1 = p->link;
p->link = q;
q->link = temp1;
temp1->link = NULL;
}
}
else if(((p->num) > x)&&((p->link)->link == NULL))
{
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
p->link = q;
q->link = p;
q->link = NULL;
}
else
{
while(1)
{
if((p->num < x)&&((p->link)->num > x))
break;
p = p->link;
}
q=(struct lx *)malloc(sizeof(struct lx));
cout<<"输入姓名:"<<endl;
cin>>q->name;
q->num = x;
temp = p->link;
p->link = q;
q->link = temp;
}
return p;
}
void listclear(str
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是当初我做的那个,用链表做的,各项都能实现好好熟悉一下,希望对你有帮助
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct stud_node{
int num;
char name[20];
int score;
struct stud_node *next;
};
struct stud_node * Create_Stu_Doc(); //新建链表
struct stud_node * InsertDoc(struct stud_node * head,struct stud_node * stud); //插入
struct stud_node * DeleteDoc(struct stud_node * head,int num); //删除
void Print_Stu_Doc(struct stud_node * head); //遍历
int main(void)
{
struct stud_node * head,*p;
int choice,num,score;
char name[20];
int size=sizeof(struct stud_node);
do{
printf("1:Create 2:Insert 3:Delete 4:Print 0:Exit\n");
scanf("%d",&choice);
switch(choice){
case 1:
head=Create_Stu_Doc();
break;
case 2:
printf("Input nun,nameand score:\n");
scanf("%d%s%d",&num,name,&score);
p=(struct stud_node * )malloc(size);
p->num=num;
strcpy(p->name,name);
p->score=score;
head=InsertDoc(head,p);
break;
case 3:
printf("Input num:\n");
scanf("%d",&num);
head=DeleteDoc(head,num);
break;
case 4:
Print_Stu_Doc(head);
break;
case 0:
break;
}
}while(choice!=0);
return 0;
}
//新建链表
struct stud_node * Create_Stu_Doc()
{
struct stud_node * head,*p;
int num,score;
char name[20];
int size=sizeof(struct stud_node);
head=NULL;
printf("Input num,name,score:\n");
scanf("%d%s%d",&num,name,&score);
while(num!=0){
p=(struct stud_node * )malloc(size);
p->num=num;
strcpy(p->name,name);
p->score=score;
head=InsertDoc(head,p);
scanf("%d%s%d",&num,name,&score);
}
return head;
}
//插入操作
struct stud_node * InsertDoc(struct stud_node * head,struct stud_node * stud)
{
struct stud_node *ptr,*ptr1, *ptr2;
ptr2=head;
ptr=stud; //ptr指向待插入的新的学生记录结点
//原链表为空时的插入
if(head==NULL){
head=ptr; //新插入结点成为头结点
head->next=NULL;
}
else{ //原链表不为空时的插入
while((ptr->num>ptr2->num)&&(ptr2->next!=NULL)){
ptr1=ptr2;
ptr2=ptr2->next;
}
if(ptr->num<=ptr2->num){
if(head==ptr2) head=ptr;
else ptr1->next=ptr;
ptr->next=ptr2;
}
else{ //新插入结点成为尾结点//
ptr2->next=ptr;
ptr->next=NULL;
}
}
return head;
}
//删除操作//
struct stud_node * DeleteDoc(struct stud_node * head,int num)
{
struct stud_node * ptr1,*ptr2;
//要被删除的结点为表头结点
while(head!=NULL && head->num==num){
ptr2=head;
head=head->next;
free(ptr2);
}
if(head==NULL) //链表空
return NULL;
//要被删除的结点为非表头结点
ptr1=head;
ptr2=head->next; //从表头的下一个结点搜索所有符合删除要求的结点
while(ptr2!=NULL){
if(ptr2->num==num){
ptr1->next=ptr2->next;
free(ptr2);
}
else
ptr1=ptr2;
ptr2=ptr1->next;
}
return head;
}
//遍历操作
void Print_Stu_Doc(struct stud_node * head)
{
struct stud_node * ptr;
if(head==NULL){
printf("\nNo Record\n");
return;
}
printf("\nThe Student Records Are: \n");
printf(" Num name score\n");
for(ptr=head;ptr;ptr=ptr->next)
printf("%8d %20s %6d\n",ptr->num,ptr->name,ptr->score);
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct stud_node{
int num;
char name[20];
int score;
struct stud_node *next;
};
struct stud_node * Create_Stu_Doc(); //新建链表
struct stud_node * InsertDoc(struct stud_node * head,struct stud_node * stud); //插入
struct stud_node * DeleteDoc(struct stud_node * head,int num); //删除
void Print_Stu_Doc(struct stud_node * head); //遍历
int main(void)
{
struct stud_node * head,*p;
int choice,num,score;
char name[20];
int size=sizeof(struct stud_node);
do{
printf("1:Create 2:Insert 3:Delete 4:Print 0:Exit\n");
scanf("%d",&choice);
switch(choice){
case 1:
head=Create_Stu_Doc();
break;
case 2:
printf("Input nun,nameand score:\n");
scanf("%d%s%d",&num,name,&score);
p=(struct stud_node * )malloc(size);
p->num=num;
strcpy(p->name,name);
p->score=score;
head=InsertDoc(head,p);
break;
case 3:
printf("Input num:\n");
scanf("%d",&num);
head=DeleteDoc(head,num);
break;
case 4:
Print_Stu_Doc(head);
break;
case 0:
break;
}
}while(choice!=0);
return 0;
}
//新建链表
struct stud_node * Create_Stu_Doc()
{
struct stud_node * head,*p;
int num,score;
char name[20];
int size=sizeof(struct stud_node);
head=NULL;
printf("Input num,name,score:\n");
scanf("%d%s%d",&num,name,&score);
while(num!=0){
p=(struct stud_node * )malloc(size);
p->num=num;
strcpy(p->name,name);
p->score=score;
head=InsertDoc(head,p);
scanf("%d%s%d",&num,name,&score);
}
return head;
}
//插入操作
struct stud_node * InsertDoc(struct stud_node * head,struct stud_node * stud)
{
struct stud_node *ptr,*ptr1, *ptr2;
ptr2=head;
ptr=stud; //ptr指向待插入的新的学生记录结点
//原链表为空时的插入
if(head==NULL){
head=ptr; //新插入结点成为头结点
head->next=NULL;
}
else{ //原链表不为空时的插入
while((ptr->num>ptr2->num)&&(ptr2->next!=NULL)){
ptr1=ptr2;
ptr2=ptr2->next;
}
if(ptr->num<=ptr2->num){
if(head==ptr2) head=ptr;
else ptr1->next=ptr;
ptr->next=ptr2;
}
else{ //新插入结点成为尾结点//
ptr2->next=ptr;
ptr->next=NULL;
}
}
return head;
}
//删除操作//
struct stud_node * DeleteDoc(struct stud_node * head,int num)
{
struct stud_node * ptr1,*ptr2;
//要被删除的结点为表头结点
while(head!=NULL && head->num==num){
ptr2=head;
head=head->next;
free(ptr2);
}
if(head==NULL) //链表空
return NULL;
//要被删除的结点为非表头结点
ptr1=head;
ptr2=head->next; //从表头的下一个结点搜索所有符合删除要求的结点
while(ptr2!=NULL){
if(ptr2->num==num){
ptr1->next=ptr2->next;
free(ptr2);
}
else
ptr1=ptr2;
ptr2=ptr1->next;
}
return head;
}
//遍历操作
void Print_Stu_Doc(struct stud_node * head)
{
struct stud_node * ptr;
if(head==NULL){
printf("\nNo Record\n");
return;
}
printf("\nThe Student Records Are: \n");
printf(" Num name score\n");
for(ptr=head;ptr;ptr=ptr->next)
printf("%8d %20s %6d\n",ptr->num,ptr->name,ptr->score);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
两年前做的,现在都不会C语言了。
下面的代码应该是对的。没有注释,但应该能看的懂,起名字也很不规范。只有信息输入、和查询,还有平均成绩。不求得分,只是拿出来共享一下,提供个参考。
#include<stdio.h>
#include<string.h>
#define pl 64
void fine(int size[][6],char xh[][5],char name[][9])
{
int i,a,b;
char d[5];
for(;;)
{
printf("请输入要查找的学号或姓名:");
scanf("%s",d);
for(i=0;i<pl;i++)
if(strcmp(d,xh[i])==0||strcmp(d,name[i])==0)
{
printf("学号:%s\t",xh[i]);
printf("姓名:%s\n",name[i]);
printf("成绩:");
for(a=0;a<5;a++)
{
printf("%d ",size[i][a]);
}
printf("\n平均成绩:%d\n\n",size[i][5]);
}
}
}
void main()
{
int size[pl][6],a,i;
char b, name[pl][9], xh[pl][5];
for(i=0;i<pl;i++)
{
printf("学号:");
scanf("%s",xh[i]);
printf("姓名:");
scanf("%s",name[i]);
printf("成绩:");
size[i][5]=0;
for(a=0;a<5;a++)
{
scanf("%d",&size[i][a]);
size[i][5]+=size[i][a];
}
size[i][5]/=5;
}
for(i=0;i<pl;i++)
{
printf("学号:%s\t",xh[i]);
printf("姓名:%s\n",name[i]);
printf("成绩:");
for(a=0;a<5;a++)
{
printf("%d ",size[i][a]);
}
printf("\n平均成绩:%d\n",size[i][5]);
}
fflush(stdin);
printf("是否要查找:y or n:\n");
scanf("%c",&b);
if(b=='y'||b=='Y')
fine(size,xh,name);
}
下面的代码应该是对的。没有注释,但应该能看的懂,起名字也很不规范。只有信息输入、和查询,还有平均成绩。不求得分,只是拿出来共享一下,提供个参考。
#include<stdio.h>
#include<string.h>
#define pl 64
void fine(int size[][6],char xh[][5],char name[][9])
{
int i,a,b;
char d[5];
for(;;)
{
printf("请输入要查找的学号或姓名:");
scanf("%s",d);
for(i=0;i<pl;i++)
if(strcmp(d,xh[i])==0||strcmp(d,name[i])==0)
{
printf("学号:%s\t",xh[i]);
printf("姓名:%s\n",name[i]);
printf("成绩:");
for(a=0;a<5;a++)
{
printf("%d ",size[i][a]);
}
printf("\n平均成绩:%d\n\n",size[i][5]);
}
}
}
void main()
{
int size[pl][6],a,i;
char b, name[pl][9], xh[pl][5];
for(i=0;i<pl;i++)
{
printf("学号:");
scanf("%s",xh[i]);
printf("姓名:");
scanf("%s",name[i]);
printf("成绩:");
size[i][5]=0;
for(a=0;a<5;a++)
{
scanf("%d",&size[i][a]);
size[i][5]+=size[i][a];
}
size[i][5]/=5;
}
for(i=0;i<pl;i++)
{
printf("学号:%s\t",xh[i]);
printf("姓名:%s\n",name[i]);
printf("成绩:");
for(a=0;a<5;a++)
{
printf("%d ",size[i][a]);
}
printf("\n平均成绩:%d\n",size[i][5]);
}
fflush(stdin);
printf("是否要查找:y or n:\n");
scanf("%c",&b);
if(b=='y'||b=='Y')
fine(size,xh,name);
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询