C语言实现简单学生学籍管理系统语言实现简单学生学籍管理系统
主要为大家详细介绍了C语言实现简单学生学籍管理系统,具有一定的参考价值,感兴趣的小伙伴们可以参考一
下
本文实例为大家分享了C语言实现学生学籍管理系统的具体代码,供大家参考,具体内容如下
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
#define N 100 /*存储100个学生的学籍信息*/
int flag; /*标记是否登录*/
struct date /*出生日期*/
{
int year;
int month;
int day;
};
struct student
{
char num[20];/*学号*/
char name[25];/*姓名*/
char sex[10];/*性别*/
struct date birthday;/*出生年月*/
int age;/*年龄*/
char addr[50];/*籍贯*/
char dept[50]; /*系别*/
char major[30]; /*专业*/
char classs[30]; /*班级*/
char phone[20];/*电话*/
}stu[N];
void login() /*登录*/
{
void menu();
system("cls");
if(flag)
{
printf(" 已经登录!");
printf("Press any key to continue…");
getchar();
getchar();
system("cls");
menu();
}
int load();
int n,i,m,w;
FILE *fp;
if((fp=fopen("D:\file.txt","rb"))!=NULL) /*不是空文件*/
n=load(); /*打开文件*/
else
n=0;
struct student s;
char password[20];
int d,q;
printf(" 请选择登录身份:1.管理员 2.用户 [ ]");
scanf("%d",&d);
if(d==1)
{
printf("\t 请输入密码:");
getchar();
int j=0;
while(1)
{
password[j]=getch();
if(password[j]=='')
break;
printf("*");
j++;
}
password[j]=' ';
if(!strcmp(password,"930322")) /*判断密码是否正确*/
{
flag=1;
printf(" 登录成功!");
printf(" Press [ Enter ] key to continue…");
getchar();
system("cls");
评论0