




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、#include #include #include #ifdef_GNUC_ #include #include #defineclearclear #defineSleep(x)usleep(x#000) #endif#ifdef_MSC_VER #include #include #defineclearsystem(cls) #endif#defineTRUE1 #defineFAUSE0 typedefstructpercharname20; intsex;charIDcard19; charphone12; intbuild_num; intunit_num; inthouse_n
2、um;floatarea; floatarea_price; floatcharge; charremarks200; structper*next;PERSON; voidzhuce(); intlogin();PERSON*Getdata(FILE*fp); voidadd_person(); voiddel(PERSON*L); voidchange(PERSON*L); voidsort_All(PERSON*L); voidpay(PERSON*L); voidsort_B_num(PERSON*L); voidmenu_1(); voidmenu_2();intmain()intc
3、heck,a;printf(t*Welcome!*、);printf(ntt1. 注冊 ); printf(ntt2. 登錄 ); printf(ntt0. 退出 ); printf(nt- 請輸入 -:);scanf(%d,&a);clear; switch(a)case0:printf(tt- 感謝使用本系統! -);Sleep(2000);exit(0);case1:zhuce();clear;check=login();while(check=FAUSE)printf(n 用戶名或密碼錯誤。 );Sleep(2000); clear;check=login();clear;menu_1
4、();break;case2:check=login();while(check=FAUSE)printf(n 用戶名或密碼錯誤。 );Sleep(2000); clear; check=login(); clear;menu_1(); break;return0;voidmenu_1()FILE*fp;inta;PERSON*head=NULL;printf(tt*歡迎使用*);printf(ntt1. 用戶添加 );printf(ntt2. 用戶修改 );printf(ntt3. 用戶刪除 );printf(ntt4. 用戶費用信息查看 );printf(ntt5. 用戶繳費 );prin
5、tf(ntt0. 退出 ); printf(nt- 請輸入 -:); scanf(%d,&a); clear;switch(a)case0:printf(- 感謝使用 !-);Sleep(3000);exit(0);case1:add_person();menu_1();break;case2:fp=fopen(data.dat,r); head=Getdata(fp); printf(%s,head-name); if(head=NULL) sa) 宀-(Lwx 廠暉報叵史*怒=)七d (nnNHH(=q=-Jep.9ep=)uedoTd)M0)OL nu tu-(pe 一l6uelp sa
6、)宀-(Lwx soodd 2S 廠暉報叵史*怒=)七UE sa) 宀-(Lwx soodd 2S 廠暉報叵史*怒=)七UE(HnNHHPe)= _(d4)9epa)oHpe 一| (q=ep.9ep=)uedord4Ln Seo 宀活qo0lnu iu0)OL nu iu ee)a)p g)2epa)oHpe 一|pay(head);menu_1(); break; voidmenu_2()FILE*fp;inta;PERSON*head=NULL;printf(tt* 用戶信息查看 *); printf(ntt1. 按樓號查看用戶物業費情況 ); printf(ntt2. 按費用信息查看用
7、戶物業費情況 ); printf(ntt0. 退出 );printf(nt- 請輸入 -:);scanf(%d,&a);clear;switch(a)case0:printf( 感謝使用 );Sleep(3000);exit(0);case1:fp=fopen(data.dat,rb); head=Getdata(fp); if(head=NULL)printf( 沒有任何數據 );Sleep(3000);exit(1);elsesort_B_num(head);menu_2();break;case2:fp=fopen(data.dat,rb); head=Getdata(fp);if(he
8、ad=NULL)printf( 沒有任何數據 );Sleep(3000);exit(1);else-n);printf(tt- 所有用戶物業費情況 sort_All(head);menu_2();break;voidzhuce()FILE*fp;charad50,key050,key150;charch;inti,j;printf(tt* 用戶注冊 *); printf(nt- 請輸入用戶名 :);scanf(%s,ad);while(1)i=0;j=0;/printf(nt- 請輸入密碼 :); initscr();noecho(); while(ch=getch()!=r)if(ch=8)
9、 printf(b); putchar(b); if(i0) i-;elseputchar(*);/ fflush(stdout);key0i+=ch; / endwin();key0i=0; printf(nt- 請再次輸入密碼 :);/initscr();/noecho();while(ch=getch()!=r) if(ch=8) printf(b);putchar(b);if(j0)j-;elseputchar(*);key1j+=ch;/ endwin();key1j=0; if(strcmp(key0,key1)!=0) clear; printf(%d,strcmp(key0,k
10、ey1); printf(t- 兩次輸入密碼不符 ,請重新輸入 -); Sleep(2000);clear;elseprintf(n-用戶 s注冊成功!-,ad);Sleep(3000); fp=fopen(admin.txt,a); fprintf(fp,%sn,ad);fclose(fp);fp=fopen(key.txt,a); fprintf(fp,%sn,key0); fclose(fp);break;intlogin()FILE*fp1,*fp2;charad50,key50;charch_150,ch_250,ch_0;inti=0,check=0;printf(tt*用戶登錄p
11、rintf(ntt- 用戶名 -);scanf(%s,ad); printf(ntt- 密碼 -);/ initscr();while(ch_0=getch()!=r) if(ch_0=8) printf(b); putchar(b); if(i0) i-;elseputchar(*); keyi+=ch_0;keyi=0;/ endwin();fp1=fopen(admin.txt,r); fp2=fopen(key.txt,r); while(!feof(fp1)fscanf(fp1,%s,ch_1); fscanf(fp2,%s,ch_2);/printf(%s,ch_1);/print
12、f(%s,ch_2);if(strcmp(ad,ch_1)=0)if(strcmp(key,ch_2)=0)check=TRUE;break;fclose(fp1);fclose(fp2);returncheck;PERSON*Getdata(FILE*fp)PERSON*head=NULL;PERSON*p1,*p2;/p1=(PERSON*)malloc(sizeof(structper); while(fread(p1,sizeof(structper),1,fp)=1) printf(%s,p1-name);if(head=NULL)head=p2=p1;elsep2-next=p1;
13、p2=p1;p1=p1-next;p1=(PERSON*)malloc(sizeof(structper); p2-next=NULL; free(p1); returnhead;voidsave(PERSON*head)FILE*fp;PERSON*p;fp=fopen(data.dat,wb+); p=head;while(p!=NULL)fwrite(p,sizeof(structper),1,fp);p=p-next;fclose(fp);voidadd_person()PERSON*p1,*p2;PERSON*head=NULL;intn;printf(ntt*用戶添加*);whil
14、e(1) p1=(PERSON*)malloc(sizeof(structper);printf(nn 請輸入用戶信息 :姓名性別 (0.女性;1.男性)身份證聯系方式樓 號單元號房號平米數每平米價格備注 nn);scanf(%s,(*p1).name);scanf(%d,&(*p1).sex);scanf(%s,(*p1).IDcard); scanf(%s,(*p1).phone); scanf(%d,&(*p1).build_num); scanf(%d,&(*p1).unit_num); scanf(%d,&(*p1).house_num); scanf(%f,&(*p1).area)
15、; scanf(%f,&(*p1).area_price); scanf(%s,(*p1).remarks);(*p1).charge=(*p1).area*(*p1).area_price*(-1);if(head=NULL)head=p2=p1;elsep2-next=p1; p2=p1;printf(nt- 用戶添加成功! -); printf(n 是否繼續添加 (1.是;0.否 ); scanf(%d,&n);if(n=0) break;p1=p1-next; p2-next=NULL; save(head); voiddel(PERSON*L)PERSON*head,*p1,*p2;
16、PERSON*p;charname20,ID19;intk=0;intn;p=(PERSON*)malloc(sizeof(structper);p-next=head=L;while(1)p1=p;printf( 請輸入所要刪除的用戶姓名及身份證號 n-);scanf(%s%s,name,ID);while(p1-next!=NULL)if(strcmp(name,p1-next-name)=0&strcmp(ID,p1-next-IDcard)=0) p2=p1-next;p1-next=p2-next; free(p2); k=1;break; p1=p1-next;head=p-nex
17、t;if(k=0)printf(nt- 沒有相關用戶! -);elseprintf(nt 刪除用戶-%s成功! ,name);printf(n 是否繼續刪除 (1.是;0 否);scanf(%d,&n);if(n=0)break;save(head);voidchange(PERSON*L)charname20,ID19;PERSON*p;intn,k=0;while(1)p=L;printf(- 請輸入所需修改用戶的姓名及身份證 -n-); scanf(%s,name);scanf(%s,ID); while(p-next!=NULL) if(strcmp(p-name,name)=0&st
18、rcmp(p-IDcard,ID)=0) k=1; break; p=p-next; if(k=0)printf(沒有查找到該用戶,是否重新輸入(1是;0.否)n-); scanf(%d,&n);if(n!=1)break;elseclear;printf(t-請輸入用戶-%s修改后信息-,p-name);printf( 姓名性別身份證聯系方式樓號單元號房號平米數每平米價格 備注);scanf(%s,(*p).name); scanf(%d,&(*p).sex); scanf(%s,(*p).IDcard); scanf(%s,(*p).phone);scanf(%d,&(*p).build_
19、num);scanf(%d,&(*p).unit_num); scanf(%d,&(*p).house_num);scanf(%f,&(*p).area);scanf(%f,&(*p).area_price);scanf(%s,(*p).remarks); (*p).charge=(*p).area*(*p).area_price;printf( 修改用戶成功 n 是否繼續修改 (1.是;0.否); scanf(%d,&n);if(n!=1) break; save(L); voidpay(PERSON*L) charname20,ID19; PERSON*head,*p; intn,k=0;
20、 floatmoney;head=L; while(1)printf(- 請輸入所需繳費的用戶及身份證 -n-); scanf(%s%s,name,ID);p=head; while(p-next!=NULL) if(strcmp(p-name,name)=0&strcmp(p-IDcard,ID)=0) k=1;break; p=p-next; if(k=0)printf( 沒有查找到該用戶,是否重新輸入 (1.是;0.否 )n-); scanf(%d,&n);if(n!=1)break;else printf( 請輸入繳費金額 :n-); scanf(%f,&money); p-charg
21、e+=money;printf( 是否繼續繳費 (1.是 ;0.否); scanf(%d,&n);if(n!=1) break;save(head);voidsort_All(PERSON*L)PERSON*p;PERSONs20,a;intn=0;inti,j;p=L;while(p-next!=NULL) strcpy(,p-name); sn.sex=p-sex; strcpy(sn.IDcard,p-IDcard); strcpy(sn.phone,p-phone); sn.build_num=p-build_num; sn.unit_num=p-unit_num; sn
22、.house_num=p-house_num; sn.area=p-area; sn.area_price=p-area_price; sn.charge=p-charge; strcpy(sn.remarks,p-remarks); n+;p=p-next;for(i=0;in;i+)for(j=i+1;jsj.charge)strcpy(,); a.sex=sj.sex;strcpy(a.IDcard,sj.IDcard); strcpy(a.phone,sj.phone); a.build_num=sj.build_num; a.unit_num=sj.unit
23、_num; a.house_num=sj.house_num; a.area=sj.area;a.area_price=sj.area_price; a.charge=sj.charge; strcpy(a.remarks,sj.remarks);strcpy(,);sn.sex=si.sex;strcpy(sj.IDcard,si.IDcard);strcpy(sj.phone,si.phone);sj.build_num=si.build_num;sj.unit_num=si.unit_num;sj.house_num=si.house_num;sj.area=
24、si.area;sj.area_price=si.area_price;sj.charge=si.charge;strcpy(sn.remarks,si.remarks);strcpy(,);si.sex=a.sex;strcpy(si.IDcard,a.IDcard);strcpy(si.phone,a.phone);si.build_num=a.build_num;si.unit_num=a.unit_num;si.house_num=a.house_num;si.area=a.area;si.area_price=a.area_price;si.charge=a.charge;strcpy(sn.remarks,a.remarks);printf( 姓名性別身份證聯系電話樓號單元號房號平米數每平米價格費用情 況備注 );for(i=0;inext!=NULL)if(p-build_num=1&p-chargename);ai.sex=p-sex;strcpy(ai.IDcard,p-IDcard);strcpy(ai.phone,p-phone);ai.build_num=p-build_num;ai.unit_num=p-unit_num;ai.hous
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 1《我們的好朋友》 公開課一等獎創新教學設計(第一課時)
- 七年級地理上冊 1.1 地球和地球儀教學設計 新人教版
- 藏族民間舞蹈的風格特點
- 美術四年級上冊7.飛天(二)教案
- 人教版小學二年級上冊數學 2.3.3 加減混合 課時練
- 專業合同勞務派遣服務 - 香港勞務指南
- 2025年新員工入職銷售崗位勞動合同電子版模板
- 2025家具采購合同模板
- 2025年公有土地有償使用合同
- 2025租房合同范本:房屋租賃合同格式
- 陳述句與反問句互改(課件)-2022-2023學年三年級語文公開課
- 2024至2030年中國車用氮氧傳感器行業市場發展調研及投資前景分析報告
- 人工肩關節置換(反肩)
- 離婚協議書范本2個孩子可打印
- 人教版 水平四 《一百米跑》說課稿
- 藏族民間舞-熱巴舞智慧樹知到期末考試答案章節答案2024年西藏大學
- 《何西阿書一概要》課件
- 超市經銷商轉場協議書
- 中華全國律師協會律師知識產權盡職調查操作指引
- 人教版高一下學期期中考試數學試卷及答案(共兩套)
- 產科診療指南及技術操作規范
評論
0/150
提交評論