|
作者: morrel [morrel] 论坛用户 | 登录 |
#include<conio.h> #include<stdio.h> #include<string.h> #define NULL 0 typedef struct node {char name[20]; long data; char address[50]; struct node *next; }node,*linklist; linklist l; save() {linklist p=l->next;FILE *fp; if((fp=fopen("TXL.txt","wb"))==NULL) {printf("cannot open file\n"); return;} while(p){ if(fwrite(p,sizeof(node),1,fp)!=1) printf("file write error\n"); p=p->next;} fclose(fp); printf("The tongxulu have saved"); } readin() {FILE *fp;linklist p=l; fp=fopen("TXL.txt","rb"); while(p){ fread(p,sizeof(node),1,fp); p=p->next; } fclose(fp); printf("have read in!"); } void initiate() { int a,i=0;long value;linklist p,r=l;int color;textbackground(1); cprintf("Please input the length of the linklist:\n"); scanf("%d",&a); for(i=0;i<a;i++) {cprintf("Please input the name , value and address NO %d:",i); p=(linklist)malloc(sizeof(node)); scanf("%s%ld%s",p->name,&value,p->address); p->data=value; r->next=p; r=p; } p->next=NULL; } insert(int i,char name[20],long b,char address[50]) {linklist p=l,s;int j=0; while(p&&j<i-1){p=p->next;++j;} if(!p||j>i-1) printf("ERROR!\n"); s=(struct node *)malloc(sizeof(node)); strcpy(s->name,name); s->data=b; strcpy(s->address,address); s->next=p->next; p->next=s; printf("OK!\n"); } delete(int i) {linklist p=l,q;int j=0; while(p->next&&j<i-1){ p=p->next;++j; } if(!(p->next)||j>i-1) printf("ERROR!"); q=p->next;p->next=q->next; free(q); printf("OK!\n"); } search(int j) {linklist p;int i=1;p=l->next; while(i<j){p=p->next;i++;} if(p==NULL)printf("ERROR!"); else{kong(25); printf("\n Personal information"); printf("\n______________________________________________________________"); printf("\nname: %s\ntel: %ld\naddress: %s\n",p->name,p->data,p->address); printf("______________________________________________________________"); kong(8); }} xiugai(int i) {linklist p;p=l->next; while(i!=1){p=p->next;i--;} printf("\nname: %s\ntel: %ld\naddress: %s\n",p->name,p->data,p->address); printf("You want to change to\n:"); printf("Please input the name , value and address NO %d:",i); scanf("%s%ld%s",p->name,&p->data,p->address); } type() {linklist p=l->next;int color;textbackground(1); printf("\n<< COMMUNICATION BOOK >>\n"); printf("______________________________________________________________"); while(p!=NULL) { printf("\nname: %s\ntel: %ld\naddress: %s\n",p->name,p->data,p->address); p=p->next; printf("______________________________________________________________"); }} kong(int c) {int j; for(j=0;j<80*c;j++)printf(" ");} menu() { printf("\nWHAT DO YOU WANT TO DO:\nBuild the communication book-----B\nIncrease a person's information-----I"); printf("\nXIU GAI a person's information-----X\nSave the communication book-----O\nRead in the communication book-----R\n"); printf("\nDelete a person's information-----D\nType all person's information-----T\nSearch a person's information-----S\nEXIT-----E"); } main() {int a,i,j,c,e;long value,b; char d,name[20],address[50],your[20],code[20];int color; textbackground(1); loopyh: kong(12); cprintf("\n PLEASE INPUT YOUR REAL NEME TO ACCESS !\n"); cprintf("name:"); scanf("%s",your); cprintf("\n KEY:"); scanf("%s",code); if(strcmp(code,"jk021")!=0) {cprintf("input ERROR!");goto loopyh;} kong(20); cprintf("\n %s, WELLCOME TO USE MY SOFTWARE OF COMMUNICATION BOOK!",your); printf("\nThe author is Fan Youzhong,you should abide by the law!"); kong(10); scanf("%c",&d); scanf("%c",&d); l=(linklist)malloc(sizeof(linklist)); l->next=NULL; kong(19); menu(); kong(8); loopz:printf("\nYOUR CHOISE:"); scanf("%c",&d); switch(d) {case 'I':goto loopi; case 'B':goto loopb; case 'D':goto loopd; case 'T':goto loopt; case 'E':goto loope; case 'S':goto loops; case 'X':goto loopx; case 'O':goto loopo; case 'R':goto loopr; default:goto loopz; } loopb: initiate(); goto loopz; loopi: printf("\nPlease input the insert position:\n"); scanf("%d",&i); cprintf("\nPlease input the insert the name , value and address:\n"); scanf("%s%ld%s",name,&b,address); insert(i,name,b,address); goto loopz; loopd: printf("\nplease input the delete position:\n"); scanf("%d",&i); delete(i); goto loopz; loopx:kong(25); printf("Input the number of person that you want to change:"); scanf("%d",&e); xiugai(e); goto loopz; loopr: readin(); goto loopz; loops:printf("INPUT THE NUMBER PERSON THAT YOU SEARCH:"); scanf("%d",&j); search(j); goto loopz; loopo:save(); goto loopz; loopt:kong(25); type(); goto loopz; loope:kong(25); cprintf("You are out!\n%s,Thank you for your use!",your); kong(10); exit(0); } |
地主 发表时间: 04-03-21 22:39 |
回复: morrel [morrel] 论坛用户 | 登录 |
我差点忘了,我还没告诉你们该程序的密码:jk021 好好用哦,有问题,通知我哦 fanyouzhong@126.com |
B1层 发表时间: 04-03-21 22:41 |
回复: sniper167 [sniper167] 论坛用户 | 登录 |
发在一个地方就够了 |
B2层 发表时间: 04-03-22 09:58 |
回复: morrel [morrel] 论坛用户 | 登录 |
通讯录程序的使用说明 该程序为范友仲同学所编,此程序为免费共享程序,为了防止他人的破坏,作 者特添加了一个固定的密码,里面一些快捷键需用户注意的是进入的密码为小写字 符,而那些菜单快捷键均为大写字母。以下为使用给程序的用户必读的内容: KEY:jk021 快捷键对应的功能如下: Build the communication book--------B 初建一个通讯录,即你将几个人的通讯方式输入其中。 Increase a person's information-----I 添加一个人的通讯方式,在此你可以选择添加的位置。 XIU GAI a person's information------X 修改某人的通讯方式,修改前它会显示对应个人原来的信息。 Delete a person's information-------D 删除某人的通讯方式。 Type all person's information-------T 显示该通讯录上所有人的通讯方式,它可以使用户在进行 以上操作后,通讯录的信息一目了蓝。 Search a person's information-------S 查找某人的信息,并将他的信息显示给用户看。 Save the communication book--------O 保存通讯录信息。 Read the communication book--------R 读入通讯录的信息。 EXIT-----E 退出程序使用,它会显示你是否退出,并感谢你的使用。 如果你已经认真读完以上信息,你可以开始使用该程序! 希望你能顺利使用我的程序! 如果在使用过程中遇到什么问题,请与本人联系:youzhongfan@yahoo.com.cn 范友仲 2004年3月14日 |
B3层 发表时间: 04-03-23 13:11 |
回复: yingzike [yingzike] 论坛用户 | 登录 |
看到源程序,还不知道口令呀! if(strcmp(code,"jk021")!=0) |
B4层 发表时间: 04-03-23 19:43 |
回复: kailangq [kailangq] 版主 | 登录 |
|
B5层 发表时间: 04-04-02 05:39 |
回复: linux [wish259] 论坛用户 | 登录 |
阿Q,你笑什么啊? |
B6层 发表时间: 04-07-28 16:16 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号