这个代码在VC6.0上可以直接使用,在vs2013上只需要加一个宏定义#define _CRT_SECURE_NO_WARNINGS就看可以使用,但是要在源文件下面加上一个(学生信息系统.txt)这样的一个文件,学生系统才能使用!!!
效果图:
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
#include"conio.h"
#define N 100
struct student
{
int num,math,english,computer;
char name[N];
double average;
};
struct node
{
struct student date;
struct node *next;
};
struct node *find(struct node *first,int num)//搜索学号;
{
struct node *p;
for(p=first;p!=NULL;p=p->next)
{
if(p->date.num==num)
{
return p;
}
}
return NULL;
}
void search(struct node *first)//查找学生信息;
{
int num;
struct node *p=NULL;
printf("请输入你想要搜索的学生的学号:");
scanf("%d",&num);
p=find(first,num);
if(p==NULL)
{
printf("没有搜索到该学生!!!\n");
}
else
{
printf("学号\t姓名\t数学\t英语\t计算机\t平均成绩\t\n");
printf("%d\t%s\t%d\t%d\t%d\t%.2f\t\n",p->date.num,p->date.name,p->date.math,p->date.english,p->date.computer,p->date.average);
}
}
struct node *update(struct node *first)//修改学生成绩;
{
int num,c,score;
struct node *p=NULL;
do
{
printf("请输入你想要修改的学生的学号:&#