#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//定义两个结构体变量用于登陆界面和信息储存
struct student //学生信息
{
char name[20];
int num;
int score;
} ;
struct password //账户和密码
{
char user[20] ;
char psw ;
struct node *next ;
} ;
struct node //结构体,用于学生信息
{
struct student data ;
struct node *next ;
} ;
typedef struct User //结构体,用于登陆菜单的账户密码核对
{
char account[8] ;
char passwd[8] ;
} User ;
struct node *createlist() ; //创建链表
struct node *createnode(struct student data) ; //创建节点
void menu(struct node *list); //登陆界面函数
void readfromfile(struct node *list, const char *filename) ; //读取文件
void savetofile(struct node *list, const char *filename); //存储文件
void insertnodebyhead(struct node *list, struct student data) ; //头插法
void deletenodebyappoin(struct node *list, int num) ; //删除节点(数据)
void changeinfo(struct node *list) ; //修改信息
void sort (struct node *list) ; //根据分数排名
int Login() ; //登陆菜单函数
int main()
{
struct node list = (struct node)malloc(sizeof(struct node)) ;
list->next = NULL ; //创建链表
readfromfile(list, “studentinfo.txt”) ; //读文件,可以读取之前存储的数据
while(1) //循环,设置两个出口,登陆菜单和退出
{
system(“cls”) ;
printf("--------信息查询系统--------\n") ;
printf("----- 1登陆 -----\n") ;
printf(" 输入 0 退出并且保存文件 “) ;
putchar(10) ; //任意键跳过,10是回车键的ASCII码函数
int choice ;
scanf(”%d",&choice) ;
switch(choice)
{
case 1:
if(Login())