




已阅读5页,还剩30页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include #include #include #include #include #include #include #include #define OK 1 #define TRUE 1 #define FALSE 0 #define SystemExit 1 #define ERROR 0 #define MAXSIZE 512 #define INIT_SIZE 50 #define INIT_INCREASE 10 #define INCREASEMENT 100 #define Number 10 int NUMBER=0;int MESSAGESIZE=0;int INITSIZE=0;int I=0;int J=0;int NUM=0;char PASSWORD30=ILOVEMYSCHOOLVERYMUCH;typedef struct Studentchar namearray30;char numberarray30;enum sax man,woman;char sax10;int age;char messageMAXSIZE;Student;Student *start;Student *head;int WelcomeMessage(void)printf( *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Welcome to come to our system! n You can only inquire your own messages! If you want to see about other n students messages,you need first to send inquirment to them,asking for n agreement,then you can visit his/her messages! n Have a good time! now you can come in! n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n 注意:系统启动码为 : ILOVEMYSCHOOLVERYMUCH ! n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n);getch();return OK;int ThankMessage(void)printf( *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Thank you for your coming to our system! n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Welcome to use our system again! n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Goodbye! n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Producer:Slimsimmy n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n Time:2007.3.22 n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n *_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*n);getch();return OK;int WarningSystem(void)int ExitCrackInError(void);int CryptographicSmartCards(void);if(:NUM=:MESSAGESIZE)start=(Student *)realloc(start,MESSAGESIZE+INIT_INCREASE);:MESSAGESIZE+=INIT_INCREASE;printf(n请输入该学生姓名(不得超过30字符!)n);scanf(%s,start:I.namearray);printf(n请输入该学生学号(不得超过30字符!)n);scanf(%s,start:I.numberarray);printf(n请输入该学生性别(%s or %s!)n,man,woman);scanf(%s,start:I.sax);printf(n请输入该学生年龄(周岁制!)n);scanf(%d,&start:I.age);printf(n请输入该学生备注(全文不得超过512字节!)n);scanf(%s,start:I.message);fp=fopen(学生基本信息任务管理文件.txt,a+);fwrite(&start:I,sizeof(Student),1,fp);fclose(fp);+:NUMBER;+:I;c=getchar();else EnterReturn();elseprintf( Do you want to enter another students message?n 1:Yes! n 2:No! n n);scanf(%d,&m);if(m=1)if(:I=:MESSAGESIZE)start=(Student *)realloc(start,MESSAGESIZE+INIT_INCREASE);:MESSAGESIZE+=INIT_INCREASE;printf(n请输入该学生姓名(不得超过30字符!)n);scanf(%s,start:I.namearray);printf(n请输入该学生学号(不得超过30字符!)n);scanf(%s,start:I.numberarray);printf(n请输入该学生性别(%s or %s!)n,man,woman);scanf(%s,start:I.sax);printf(n请输入该学生年龄(周岁制!)n);scanf(%d,&start:I.age);printf(n请输入该学生备注(全文不得超过512字节!)n);scanf(%s,start:I.message);fp=fopen(学生基本信息任务管理文件.txt,a+);fwrite(&start:I,sizeof(Student),1,fp);fclose(fp);+:NUMBER;+:I;c=getchar();else EnterReturn();getch();return OK;int NumberfistEnter(void)int EnterMessage(void);int SaveMessage(void);FILE *fp;int n=0;int i=0;printf(Please enter the number of the messages!n);scanf(%d,&n);if(n=0)printf(You would not enter any message!n Press any key , and system will return.n);EnterMessage();else if(n0)printf(Your enter is illeagle!n);printf(Press any key , and system will return.n);EnterMessage();elsefor(i=1;i=:MESSAGESIZE)start=(Student *)realloc(start,MESSAGESIZE+INIT_INCREASE);:MESSAGESIZE+=INIT_INCREASE;printf(n请输入该学生姓名(不得超过30字符!)n);scanf(%s,start:I.namearray);printf(n请输入该学生学号(不得超过30字符!)n);scanf(%s,start:I.numberarray);printf(n请输入该学生性别(%s or %s!)n,man,woman);scanf(%s,start:I.sax);printf(n请输入该学生年龄(周岁制!)n);scanf(%d,&start:I.age);printf(n请输入该学生备注(全文不得超过512字节!)n);scanf(%s,start:I.message);fp=fopen(学生基本信息任务管理文件.txt,a+);fwrite(&start:I,sizeof(Student),1,fp);fclose(fp);+:I;getch();getch();return OK;int FileEnter(void)FILE *fp1,*fp2;char filename30;printf(Please enter the filename!n);scanf(%s,filename);if(fp2=fopen(filename,r)=NULL)printf(Cannot open the file!n Please check your enter and open it later!n Press any key and the system will return.nn);return ERROR;fp1=fopen(学生基本信息任务管理文件.txt,a+);fseek(fp2,92L,0);while(!feof(fp2)if(:I=:MESSAGESIZE)start=(Student *)realloc(start,MESSAGESIZE+INIT_INCREASE);:MESSAGESIZE+=INIT_INCREASE;if(:J=:INITSIZE)head=(Student *)realloc(head,INITSIZE+INCREASEMENT);:INITSIZE+=INCREASEMENT;fread(&head:J,sizeof(Student),1,fp2);fwrite(&start:I,sizeof(Student),1,fp1);+:I;+:J;fclose(fp1);fclose(fp2);return OK;int ReturnEnter(void)int System(void);System();return OK;int EnterMessage(void)int ExitSystem(void);char choice;while(1) /第二次while(1)循环部分,将完成各种遍历方式,及退出操作 printf(_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_n 输入方式选择菜单nn 1:逐次询问输入方式!n 2:定数插入输入方式!n 3:文件导入输入方式!n 4.不想输入,返回前页!n 5.退出系统!n 注意:!n 系统默认方式为定数插入方式录入新的内容!nn);printf(_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_n);do printf(n请输入您的选择:n);choice=getch();putch(choice);while(choice=Esc);printf(nnn);switch (choice)case 1:RequistEnter(); break;case 2:NumberfistEnter(); break;case 3:FileEnter(); break;case 4:ReturnEnter(); break;case 5:ExitSystem(); break;default:NumberfistEnter();break;getch();getch();return OK;int DisplayMessage(void)FILE *fp;int i;fp=fopen(学生基本信息任务管理文件.txt,r);fseek(fp,92L,0);for(i=0;i:I;i+)fread(&headi,sizeof(Student),1,fp);printf(*n !n *n 姓名 : %s 学号: %s 性别 : %s n 年龄: %d n 其他备注信息: %s n *n !n *n ,array,headi.numberarray,headi.sax,headi.age,headi.message);fclose(fp);return OK;int DeleteAll(void)FILE *fp;fp=fopen(学生基本信息任务管理文件.txt,w+);fprintf(fp,%s,班级人员详细
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论