C语言数据库-学生成绩统计管理系统
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
学生成绩统计管理系统C语言数据结构课程作品
指导老师:
学生:
学号:
班级:
一、代码
#include""
#include<>
#include<>
#include<>
#include<>
#include<>
#include<>
#include<>
struct grade
{
int score;
struct grade *next;
}; /*定义成绩的结构*/
struct address{
char stu_num[4]; /*学号*/
char hname[10]; /*性别*/
char ename[20]; /*姓名*/
char depart[30]; /*系别*/
char paddress[30]; /*地址*/
char phone[13] /*联系电话*/;
struct grade *head;
struct address *next;
} ;
void loaddata (struct address **had);
void printm (struct address *head);
struct address * seek (struct address *head);
void revise (struct address *hp);
void delate (struct address **head);
void saveda (struct address *tou );
void addnew (struct address **had );
void moveg (int i,struct grade **move);
void gotoxy(int x,int y);
void sortp(struct address **head);
int main ( void )
{
char ch;
int c;
struct address *head=NULL;
loaddata(&head);
do
{
system("cls");
printf(" \n");
printf("学生信息与成绩统计:\n");
printf(" 岳鹏程制作\n");
printf("
===============================================\n");
printf("‖ Menu: ‖\n");
printf("‖ 1:print all the personal information. ‖\n");
printf("‖ 2:insert some or one person. ‖\n");
printf("‖ 3:revire some information. ‖\n");
printf("‖ 4:delate some information or a person. ‖\n");
printf("‖ 5:exit. ‖\n");
printf("
===============================================\n");
printf("\tInput :");
do
{
scanf("%d",&c);
getchar( );
}while(c<0||c>6);
switch ( c )
{
case 1:
printm(head);
break;
case 2:
addnew(&head);
break;
case 3:
revise(head);
break;
case 4:
delate(&head);
break;
break;
case 5:
return 0;
default:
break;
}
fflush(stdin);
printf("continue or not: input y or n\n");
ch=getchar( );
saveda(head);
}while(ch=='y'||ch=='Y');
return 0;
}
void loaddata (struct address **had )
{
FILE *afhead;
FILE *gfhead;
struct address *p1,*hp1=NULL,*head=NULL;
struct grade *p2 , *hp2 = NULL;
int i=0;
int j=6;
if( !(afhead = fopen("d:\\","rb")))
{
return;
}
if( !(gfhead = fopen("d:\\" , "rb")) )
{
return;
}
while (!feof(afhead))
{
p1 = (struct address *)malloc(sizeof(struct address));
fread(p1,sizeof(struct address),1,afhead);