C++學生信息管理系統(tǒng)
本文實例為大家分享了C++學生信息管理系統(tǒng)源碼,供大家參考,具體內(nèi)容如下
1. tea_list.c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"teacher.h"
int sq_tea ;
PTEA head = NULL ;
FILE *fp ;
int tea_llopen(const char* path)//打開文件
{
fp=fopen(path,"r");
if(fp==NULL){
perror("open fail");
return -1;}
#ifdef DEBUG
printf ("debug--001") ;
#endif
PTEA p;
int ret;
while(p)
{
p=malloc(sizeof(TEA));
if(p==NULL){
perror("申請空間不夠");
return -1;}
ret=fscanf(fp,"%d%d%d%s%s",
&p->id,&p->age,&p->wages,p->name,p->passwd);
if(ret<=0) break;
if(head==NULL){
p->next=NULL;
p->pre=NULL;
head=p;}
else{
p->next=head;
p->pre=NULL;
head->pre=p;
head=p;}
}
return 0;
}
#if 1
int tea_llshow( )//顯示
{
if(head==NULL)
return -1;
PTEA p=head;
printf("工號\t年齡\t工資\t姓名\n");
while(p)
{
printf("%d\t%d\t%d\t%s\n",
p->id,p->age,p->wages,p->name);
p=p->next;
}
return 0;
}
PTEA tea_llcheck(PTEA a)//查找
{
printf("輸入查找教師工號\n");
int id;
scanf("%d",&id);
while(getchar()!='\n');
PTEA p;
p=head;
while(p)
{
if(p->id==id){
printf ("工號\t年齡\t薪水\t姓名\n " );
printf ("%d\t%d\t%d\t%s\n",p->id,p->age,p->wages,p->name);
break ;
}
p=p->next;
}
if (p==NULL) {
printf ("未找到該教師\n");
printf ("是否繼續(xù)查找y/n\n") ;
char ch ;
getchar();
ch=getchar();
if((ch=='y')||(ch=='Y'))
tea_llcheck (p ) ;
else
return NULL ;
}
return 0;
}
#endif
#if 1
int tea_lladd(PTEA b )//增加老師信息
{
#ifdef _DEBUG_
printf ("debug-001\n") ;
#endif
PTEA p ;
char ch ;
p=malloc(sizeof(TEA));
if(p==NULL){
perror("申請空間不夠\n");
return -1;}
printf ("請輸入添加老師的信息\n工號\t年齡\t薪水\t姓名\t密碼\n") ;
scanf("%d%d%d%s",&p->id,&p->age,&p->wages,p->name,p->passwd) ;
while(getchar()!='\n');
if ( p == NULL )
return -1 ;
if ( head == NULL ) //說明鏈表為空,加入成第一個
{ p->next = NULL ;
p->pre = NULL ;
head->pre = p ;
head = p ;
}
else {
p->next=head ;
p->pre=NULL ;
head->pre = p ;
head=p ;
}
/* fprintf ( fp , "%d\t%d\t%d\t%s\n",p->id,p->age,p->wages,p->name ) ;
fclose ( fp ) ;
fopen ("teacher.txt" , "a+");
*/
return 0 ;
}
#endif
#if 1
int tea_lldelete( PTEA a ) //刪除老師
{ int key ;
printf ("請輸入要刪除的老師的工號\n") ;
scanf ("%d",&key);
while(getchar()!='\n');
PTEA p ;
PTEA q ;
p = head ;
while (p)
{ if (p->id == key )
{
if( (p == head)&&(head->next!=NULL) )
{ head = head->next ;
head->pre = NULL ;
#ifdef _DEBUG_
printf ("case 1\n") ;
#endif
}
else if ((p==head) && ( head->next==NULL))
{ head = NULL ;
#ifdef _DEBUG_
printf ("case 2\n") ;
#endif
}
else if( (p!=head )&&(p->next!=NULL) )
{p->pre->next=p->next ;
p->next->pre = p->pre ;
#ifdef _DEBUG_
printf ("case 3\n ") ; I
#endif
}
else { p->pre->next = NULL ;
#ifdef _DEBUG_
printf ("case 4\n") ;
#endif
}
break ;
}
p = p->next ;
}
free (p) ;
if (p==NULL)
printf ("未找到該教師") ;
/* fp = fopen("teacher.txt","r+");
while(p){
fprintf (fp ," %d\t%d\t%d\t%s\n" , p->id , p->age ,p->wages , p->name );
p=p->next ;
}
fclose (fp) ;
tea_llopen ;
*/ }
#endif
#if 1
int tea_llchange()//修改老師信息
{
PTEA p;
printf("\n輸入工號");
int key;
scanf("%d",&key);
while(getchar()!='\n');
p=head;
while(p)
{
if(p->id==key){
printf("工號\t年齡\t薪水\t姓名\n");
scanf("%d%d%d%s%s",
&p->id,&p->age,&p->wages,p->name,p->passwd);
while(getchar()!='\n');
break ;
}
p=p->next;}
p = head ;
printf ("修改之后為\n");
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\t密碼\n");
while(p)
{
printf("%d\t%d\t%d\t%s\t%s\n",
p->id,p->age,p->wages,p->name,p->passwd);
p=p->next;
}
return 0;
}
#endif
#if 1
PTEA tea_check_id() //校驗老師用戶名
{
PTEA p;
p = head;
int id;
char ch;
printf("請輸入您的工號:");
scanf("%d",&id);
while(getchar()!='\n');
while(p)
{
if(p->id==id){
return p;
}
p = p->next;
}
if(p==NULL){
printf("找不到該用戶\n");
printf("是否重試?[y/n]\n");
// scanf("%c",&ch) ;
// getchar () ;
ch = getchar () ;
if ((ch=='y')||(ch=='Y'))
tea_check_id();
else
menu();
}
}
#endif
#if 1
PTEA tea_check_passwd() //校驗老師密碼
{
PTEA p;
p =tea_check_id();
char passwd[20];
char ch;
printf("請輸入密碼:");
scanf("%s",passwd);
while(getchar()!='\n');
if(strcmp (p->passwd , passwd)==0)
{
sq_tea = p->id ;
#ifdef _DEBUG_
printf("================%d\n",p->id) ;
printf("================%d\n",sq_tea) ;
getchar();
getchar();
#endif
return p;
}else{
printf("密碼不正確\n");
printf("是否重新輸入[y/n]\n");
// getchar() ;
ch = getchar () ;
while(getchar()!='\n');
if((ch=='y')||(ch=='Y'))
tea_check_passwd();
else
menu();
}
return NULL;
}
#endif
#if 1
int tea_change_passwd()
{
PTEA p;
p=tea_check_passwd();
char new_passwd[20];
char new[20];
char ch;
printf("請輸入新密碼:");
scanf("%s",new_passwd);
while(getchar() != '\n');
printf("請再次輸入新密碼:");
scanf("%s",new);
while(getchar() != '\n');
if(strcmp(new_passwd,new)==0)
{
strcpy(p->passwd,new_passwd) ;
printf("密碼修改成功!\n");
// tea_write() ;
}
else
{
printf("密碼輸入錯誤\n");
printf("是否重試[y/n]\n");
// getchar();
ch=getchar() ;
while(getchar()!='\n');
if((ch=='y')||(ch=='Y'))
tea_change_passwd();
else
exit(1);
}
return 0;
}
#endif
#if 1
int tea_lookme()
{
PTEA p;
p = head ;
while (p) {
if( p->id == sq_tea ) {
printf("工號\t年齡\t薪水\t姓名\t密碼\n");
printf("%d\t%d\t%d\t%s\n%s\n",
p->id,p->age,p->wages,p->name,p->passwd);
}
p = p->next ;
}
return 0 ;
}
#endif
#if 1
int tea_write()
{
PTEA p;
// PTEA head ;
FILE *fp;
p=head;
fp=fopen("teacher.txt","w+");
while(p)
{
fprintf( fp,
"%d\t%d\t%d\t%s\t%s\n",
p->id,p->age,p->wages,p->name,p->passwd);
p=p->next;
}
return 0;
}
#endif
#if 0
int main(int argc,char * argv[])
{
if(argc<2){
printf("execult error");
return -1;}
int ret;
PTEA p;
ret=tea_llopen(argv[1]);
if(ret<0){
printf("list is end\n");
return -1;}
// tea_llshow(head);
// int id;
/* p=tea_llcheck();
printf("%d\t%d\t%d\t%s\n",
p->id,p->age,p->wages,p->name);
*/ //tea_llshow();
// tea_lladd(head) ;
// tea_llshow(head) ;
// tea_lldelete( head ) ;
// tea_llshow(head) ;
tea_llcheck(head) ;
return 0;
}
#endif
2. stu_list.c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"student.h"
PSTU head1 = NULL ;
int sq_stu ;
#if 1
FILE*fp;
int stu_llopen(char* path)//打開文件
{
fp=fopen(path,"r");
if(fp==NULL){
perror("open fail");
return -1;}
#ifdef _DEBUG_
printf ("open susess\n") ;
#endif
PSTU p;
int ret;
while(p)
{
#ifdef _DEBUG_
perror("while -time\n");
#endif
p=malloc(sizeof(STU));
if(p==NULL){
printf("申請空間不夠");
return -1;}
ret=fscanf(fp,"%d%d%d%d%d%d%s%s",
&p->id,&p->age,&p->math,&p->english,
&p->chinese,&p->class,p->name,p->passwd);
#ifdef _DEBUG_
printf("ret is ok\n") ;
#endif
if(ret<=0) {
#ifdef _DEBUG_
printf ("list is end \n ") ;
#endif
break;
}
if(head1==NULL){
p->next=NULL;
p->pre=NULL;
head1=p;}
else{
p->next=head1;
p->pre=NULL;
head1->pre=p;
head1=p;}
}
return 0;
}
#endif
int stu_llshow()//顯示
{
// FILE *fp;
if(head1==NULL)
return -1;
PSTU p=head1;
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\n");
while(p)
{
printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,
p->class,p->name);
p=p->next;
}
// fflush(stdout) ;
return 0;
}
int stu_llcheck()//查找
{
printf("\n輸入查找學號\n");
int key;
scanf("%d",&key);
while(getchar()!='\n');
PSTU p;
p=head1;
if(head1==NULL)
{
printf ("打開鏈表失敗") ;
return -1;
}
while(p)
{
if(p->id==key) {
#ifdef _DEBUG_
printf ("while p ") ;
#endif
printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,
p->class,p->name);
break ;
}
p=p->next;
}
if (p==NULL) {
printf ("未找到該學生");
printf ("是否繼續(xù)查找y/n") ;
char ch ;
ch=getchar();
while(getchar()!='\n');
if((ch='y')||(ch=='Y'))
stu_llcheck() ;
else exit(1) ;
}
return 0;
}
int __stu_lladd(PSTU p)//被調(diào)用添加
{
if(p==NULL) return -1;
if(head1==NULL){
p->next=NULL;
p->pre=NULL;
head1->pre=p;
head1=p;}
else{
p->next=head1;
p->pre=NULL;
head1->pre=p;
head1=p;}
return 0;
}
int stu_lladd()//添加
{
PSTU p;
p=malloc(sizeof(STU));
if(p==NULL) return -1;
printf("\n輸入添加學生信息\n\n");
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\t密碼\n");
scanf("%d%d%d%d%d%d%s",
&p->id,&p->age,&p->math,&p->english,
&p->chinese,&p->class,p->name,p->passwd);
__stu_lladd(p);
/* fprintf( fp ,
"%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,p->class,p->name );
fclose (fp) ;
fp = fopen ("student.txt","r" ) ;
*/
return 0;
}
#if 1
int __stu_lldelete(int id)//被調(diào)用的刪除
{
PSTU p;
PSTU q=NULL;
p=head1;
while(p)
{
if(p->id==id){
if(p==head1){
if(head1->next){
head1=head1->next;
head1->pre=NULL;}
else{
head1=NULL;}
}
else{
if(p->next){
p->pre->next=p->next;
p->next->pre=p->pre;}
else{
p->pre->next=NULL;}
}
break;
}
p=p->next;
}
if (p==NULL) {
printf ("未找到該學生\n");
}
free(p);
/* fclose (fp) ;
p=head1 ;
fp = fopen("student.txt","w+");
while(p){
fprintf (fp ,
"%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,p->class, p->name);
p=p->next ;
}
fclose (fp) ;
fp = fopen ("student.txt","r" ) ;
p=head1 ;
stu_llopen("") ;
*/}
int stu_lldelete()//刪除
{
int id;
PSTU p;
printf("\n輸入刪除學號\n");
scanf("%d",&id);
while(getchar()!='\n') ;
return __stu_lldelete(id);
}
#endif
#if 1
int stu_llchange()//修改
{
PSTU p;
printf("\n輸入修改學號");
int key;
scanf("%d",&key);
while(getchar() != '\n');
p=head1;
while(p)
{
if(p->id==key){
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\t密碼\n");
scanf("%d%d%d%d%d%d%s%s",
&p->id,&p->age,&p->math,&p->english,
&p->chinese,&p->class,p->name,p->passwd);
break ;
}
p=p->next;}
/* fprintf( fp ,
"%d\t%d\t%d\t%d\t%d\t%s\t%d\n",
p->id,p->age,p->math,p->english,p->chinese,p->name,p->class );
printf("學號\t年齡\t數(shù)學\t英語\t語文\t姓名\t班級");
*/ p = head1 ;
printf ("修改之后為\n");
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\n");
while(p)
{
printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,
p->class,p->name);
p=p->next;
}
return 0;
}
#endif
#if 1 //排序
int stu_sort()
{
PSTU p ;
// p->sum == (p->math + p->english + p->chinese) ;
PSTU new_head1=NULL;
PSTU q=NULL,max=head1,prev;
printf ("按照總成績排序\n");
while(head1)
{
//1,找到最大分數(shù)的節(jié)點地址
max = head1;
prev=q=NULL;
p=head1;
while(p)
{
if( (p->math+p->english+p->chinese) > (max->math+max->english+max->chinese) )
{
max = p;
prev= q;
}
q = p;
p=p->next;
}
if(prev){
prev->next = max->next;
}else{
head1= head1->next;
}
//3,把該節(jié)點頭插到新鏈表頭指針
max->next = new_head1;
new_head1 = max;
}
head1 = max;
stu_llshow() ;
return 0 ;
}
#endif
#if 1
PSTU stu_check_id() //校驗學生用戶名
{
PSTU p;
p = head1;
int id;
char ch;
printf("請輸入您的學號:");
scanf("%d",&id);
while(getchar() != '\n');
while(p)
{
if(p->id==id){
return p;
}
p = p->next;
}
printf ("找到該用戶\n") ;
if(p==NULL){
printf("找不到該用戶\n");
printf("是否重試?[y/n]\n");
ch = getchar () ;
while(getchar()!='\0');
if ((ch=='y')||(ch=='Y'))
stu_check_id();
else
menu();
}
}
#endif
#if 1
PSTU stu_check_passwd() //校驗學生密碼
{
PSTU p;
p =stu_check_id();
char passwd[20];
char ch;
printf("請輸入密碼:");
scanf("%s",passwd);
while(getchar()!='\n') ;
if(strcmp (p->passwd , passwd)==0)
{
sq_stu = p->id ;
return p;
}else{
printf("密碼不正確\n");
printf("是否重新輸入[y/n]\n");
ch = getchar () ;
while(getchar()!='\n');
if((ch=='y')||(ch=='Y'))
stu_check_passwd();
else
menu();
}
return NULL;
}
#endif
#if 1
int stu_change_passwd()
{
PSTU p;
p=stu_check_passwd();
// p->passwd=1234;
char new_passwd[20];
char new[20];
char ch;
printf("請輸入新密碼:");
scanf("%s",new_passwd);
while(getchar() != '\n');
printf("請再次輸入新密碼:");
scanf("%s",new);
while(getchar()!='\n') ;
if(strcmp(new_passwd,new)==0)
{
strcpy(p->passwd,new_passwd) ;
printf("密碼修改成功!\n");
}
else
{
printf("密碼輸入錯誤\n");
printf("是否重試[y/n]\n");
ch=getchar();
while (getchar()!='\n') ;
if((ch=='y')||(ch=='Y'))
stu_change_passwd();
else
student_menu();
}
return 0;
}
#endif
#if 1
int stu_lookme()
{
PSTU p;
p = head1 ;
#ifdef _DEBUG_
printf ("%d\n",sq_stu) ;
#endif
while (p) {
if (p->id==sq_stu){
printf("學號\t年齡\t數(shù)學\t英語\t語文\t班級\t姓名\t密碼\n");
printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\n",
p->id,p->age,p->math,p->english,p->chinese, p->class,p->name,p->passwd);
} p = p->next ;
}
return 0 ;
}
#endif
#if 1
int stu_write()
{
PSTU p;
FILE *fp;
// PSTU head1 ;
p=head1;
fp=fopen("student.txt","w");
while(p)
{
fprintf( fp,
"%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,p->class,p->name,p->passwd);
p=p->next;
}
return 0;
}
#endif
#if 1
void stu_check_class()
{
int class ;
PSTU p ;
int i=0 ;
p = head1 ;
printf ("請輸入您要查找的班級:\n");
scanf ("%d",&class);
while(getchar()!='\n') ;
while (p){
if (p->class==class ) {
printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\n",
p->id,p->age,p->math,p->english,p->chinese,
p->class,p->name);
i++ ; }
p=p->next;
}
if((p==NULL)&&(i==0))
printf("未找到該班級\n");
}
#endif
#if 0
int main(int argc,char * argv[])
{
/* if(argc<2){
printf("execult error");
return -1;}
*/ int ret;
PSTU p;
ret=stu_llopen("student.txt");
if(ret<0){
printf("創(chuàng)建失敗\n");
return -1;}
printf ("debug-000\n") ;
// int id;
stu_llshow();
// stu_lldelete();
// stu_llcheck() ;
// stu_llshow();
stu_check_class() ;
// stu_llchange();
// sleep (1) ;
// stu_llshow();
// stu_sort();
// stu_llshow();
return 0;
}
#endif
3. student.txt
1002 25 100 90 85 1 s1 000
1003 25 107 90 84 1 s1 000
1004 25 100 90 80 1 s1 000
1005 25 107 90 80 1 s1 000
1006 25 100 90 80 1 s1 000
1007 25 108 90 80 1 s1 000
1008 25 100 78 80 1 s1 000
1009 25 100 90 80 1 s1 000
1010 25 100 45 80 1 s1 000
1012 25 90 90 80 1 s1 000
4. teacher.txt
10002 75 4500 wang2 000
10003 75 4500 wang3 000
10004 75 4500 wang4 000
10005 75 4500 wang5 000
10006 75 4500 wang6 000
10007 75 4500 wang7 000
10008 75 4500 wang8 000
10009 75 4500 wang9 000
10010 75 4500 wang10 000
10011 75 4500 wang11 000
10012 75 4500 wang12 000
10013 75 4500 wang13 000
10014 75 4500 wang14 000
10015 75 4500 wang15 000
10016 75 4500 wang16 000
10017 75 4500 wang17 000
10018 75 4500 wang18 000
5. menu.c
#include"student.h"
#include"teacher.h"
#if 1
void admin_menu_1()
{
char u[20]="";
char u1[20]="admin";
char p[20]="";
char p1[20]="admin";
while (1)
{
printf("管理員用戶名\n");
scanf("%s",u);
while(getchar()!= '\n');
printf("管理員密碼\n");
scanf("%s",p);
while(getchar()!= '\n');
if (strcmp(u,u1)==0&&strcmp(p,p1)==0)
admin_menu_2() ;
else
printf ("輸入用戶名或密碼不正確,是否重試y/n\n");
char ch ;
ch=getchar() ;
while(getchar()!= '\n');
if ((ch=='y')||(ch=='Y'))
admin_menu_1() ;
else
menu() ;
}
}
#endif
#if 1
void admin_menu_2() {
while(1)
{ system ("clear");
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.管理老師 *\n");
printf("\t\t\t\t* 2.管理學生 *\n");
printf("\t\t\t\t* 0.返回 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
char ch ;
ch=getchar();
while(getchar()!= '\n');
switch(ch)
{
case '1':
admin_menu_2_1() ;
break ;
case '2':
admin_menu_2_2() ;
break ;
case '0':
menu();
default:
admin_menu_2() ;
break;
}
}
}
#endif
#if 1
void teacher_menu()
{
tea_check_passwd();
char ch;
while(1)
{
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.查找學生信息 *\n");
printf("\t\t\t\t* 2.按總成績排名 *\n");
printf("\t\t\t\t* 3.修改老師密碼 *\n");
printf("\t\t\t\t* 4.查看我的信息 *\n");
printf("\t\t\t\t* 5.按照班級查找學生 *\n");
printf("\t\t\t\t* 0.返回 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
ch=getchar();
while(getchar()!='\n');
switch(ch)
{
case '1':
//admin_tea_delete();break;
stu_llshow();
stu_llcheck();
break;
case '2':
stu_sort() ;
break ;
case '3':
printf ("修改老師密碼\n") ;
tea_change_passwd() ;
break ;
case '4':
printf("我的信息\n");
tea_lookme() ;
break;
case '5':
printf("按照班級查找\n");
stu_check_class();
break ;
case '0':
menu();
default :
printf("字符不符\n");
break;
}
}
}
#endif
#if 1
void student_menu()
{
stu_check_passwd();
while(1)
{
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.查詢我的信息 *\n");
printf("\t\t\t\t* 2.修改學生密碼 *\n");
printf("\t\t\t\t* 0.返回 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
char ch;
ch=getchar();
while(getchar()!='\n');
switch(ch)
{
case '1':
printf("查詢我的信息\n");
stu_lookme();
break;
case '2':
printf("修改密碼\n");
stu_change_passwd();
break;
case '0':
menu() ;// break;//exit(0);
default :
printf("請輸入\n");
break;
}
}
}
#endif
#if 1
void menu()
{
char ch;
while(1)
{ system ("clear");
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 歡迎進入學生管理系統(tǒng) *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.管理員登錄 *\n");
printf("\t\t\t\t* 2.老師登錄 *\n");
printf("\t\t\t\t* 3.學生登錄 *\n");
printf("\t\t\t\t* 0.保存并退出 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
ch=getchar();
while(getchar()!= '\n');
switch(ch)
{
case '1':
admin_menu_1();break;
case '2':
teacher_menu(); break;
case '3':
student_menu();break;
case '0':
tea_write() ;
stu_write() ;
exit(0) ; //break;//exit(0);
default :
printf("輸入不存在的字符\n");
break;
}
}
}
#endif
#if 1
void admin_menu_2_1() {
while(1)
{
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.刪除老師 *\n");
printf("\t\t\t\t* 2.添加老師 *\n");
printf("\t\t\t\t* 3.查找老師 *\n");
printf("\t\t\t\t* 4.修改老師 *\n");
printf("\t\t\t\t* 5.查看全部老師 *\n");
printf("\t\t\t\t* 0.返回 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
char ch ;
ch=getchar();
while(getchar()!='\n');
switch(ch)
{
case '1':
//admin_tea_delete();break;
printf("刪除教師\n");
tea_llshow( ) ;
tea_lldelete() ;
break;
case '2':
printf("添加教師\n");
tea_lladd( ) ;
tea_llshow() ;
break;
//admin_tea_add();break;
case '3':
printf("查找教師\n");
tea_llcheck( ) ;
break;
//admin_tea_cheak();break;
case '4':
printf("修改老師\n");
tea_llchange() ;
break;
case '5':
printf("查看全部老師\n");
tea_llshow() ;
break;
//
case '0':
admin_menu_2() ;// break;//exit(0);
default :
printf("字符不符\n");
break;
}
}
}
#endif
#if 1
void admin_menu_2_2() {
while(1)
{
printf("\n\n\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t* 1.刪除學生 *\n");
printf("\t\t\t\t* 2.添加學生 *\n");
printf("\t\t\t\t* 3.查找學生 *\n");
printf("\t\t\t\t* 4.修改學生 *\n");
printf("\t\t\t\t* 5.查看全部學生 *\n");
printf("\t\t\t\t* 0.返回 *\n");
printf("\t\t\t\t******************************\n");
printf("\t\t\t\t請輸入數(shù)字選擇\n");
char ch ;
ch=getchar();
while(getchar()!='\n');
switch(ch)
{
case '1':
printf ("刪除學生");
stu_llshow();
stu_lldelete();
stu_llshow();
break ;
case '2':
printf("添加學生\n");
stu_lladd();
stu_llshow();
break ;
case '3':
printf("查找學生\n");
stu_llcheck();
break;
case '4':
printf("修改學生\n");
stu_llchange();
break;
case '5':
printf("查看全部學生\n");
stu_llshow() ;
break;
case '0':
admin_menu_2() ;
default :
printf("請選擇\n");
break;
}
}
}
#endif
#if 1
int main()
{
stu_llopen(FILENAME1);
tea_llopen(FILENAME);
#ifdef _DEBUG_
stu_llshow();
tea_llshow();
#endif
sleep(1);
system ("clear");
menu();
}
#endif
關(guān)于管理系統(tǒng)的更多內(nèi)容請點擊《管理系統(tǒng)專題》進行學習
以上就是本文的全部內(nèi)容,希望對大家學習C++管理系統(tǒng)有所幫助。
上一篇:簡單掌握Linux系統(tǒng)中fork()函數(shù)創(chuàng)建子進程的用法
欄 目:C語言
下一篇:Linux下C語言的fork()子進程函數(shù)用法及相關(guān)問題解析
本文標題:C++學生信息管理系統(tǒng)
本文地址:http://www.jygsgssxh.com/a1/Cyuyan/2229.html
您可能感興趣的文章
- 04-02c語言沒有round函數(shù) round c語言
- 01-10深入理解C++中常見的關(guān)鍵字含義
- 01-10使用C++實現(xiàn)全排列算法的方法詳解
- 01-10c++中inline的用法分析
- 01-10用C++實現(xiàn)DBSCAN聚類算法
- 01-10全排列算法的非遞歸實現(xiàn)與遞歸實現(xiàn)的方法(C++)
- 01-10C++大數(shù)模板(推薦)
- 01-10淺談C/C++中的static與extern關(guān)鍵字的使用詳解
- 01-10深入C/C++浮點數(shù)在內(nèi)存中的存儲方式詳解
- 01-10深入理解C/C++混合編程


閱讀排行
本欄相關(guān)
- 04-02c語言函數(shù)調(diào)用后清空內(nèi)存 c語言調(diào)用
- 04-02func函數(shù)+在C語言 func函數(shù)在c語言中
- 04-02c語言的正則匹配函數(shù) c語言正則表達
- 04-02c語言用函數(shù)寫分段 用c語言表示分段
- 04-02c語言中對數(shù)函數(shù)的表達式 c語言中對
- 04-02c語言編寫函數(shù)冒泡排序 c語言冒泡排
- 04-02c語言沒有round函數(shù) round c語言
- 04-02c語言分段函數(shù)怎么求 用c語言求分段
- 04-02C語言中怎么打出三角函數(shù) c語言中怎
- 04-02c語言調(diào)用函數(shù)求fibo C語言調(diào)用函數(shù)求
隨機閱讀
- 01-10C#中split用法實例總結(jié)
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 08-05dedecms(織夢)副欄目數(shù)量限制代碼修改
- 01-11ajax實現(xiàn)頁面的局部加載
- 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置
- 08-05DEDE織夢data目錄下的sessions文件夾有什
- 04-02jquery與jsp,用jquery
- 08-05織夢dedecms什么時候用欄目交叉功能?
- 01-10使用C語言求解撲克牌的順子及n個骰子
- 01-10delphi制作wav文件的方法


