版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、#i nclude "stdio.h"#i nclude "stdlib.h"#include "string.h"#defi ne M 5 struct Peopleint a;char min g30; char xia ng30;int b;int c;PM;void mai n()int a=1;void menu _1(i nt a); menu _1(a); void menu _1(i nt a)void menu _2();void menu _3();void biao_1(); int loop=1;while(l
2、oop)system("cls");prin tf("tWELCOMEn");printf("t(*A A*)n ”);prin tf("t-n");prin tf("t-n");prin tf("t-1.小區(qū)用戶管理-n");prin tf("t-2.物業(yè)收費管理-n");prin tf("t-3.生成小區(qū)住戶收費報表-n");prin tf("t-4.退出-n");prin tf("t-n");prin
3、 tf("t-n");printf("t-0(丿 口3)0n");prin tf("tENDn");prin tf(”請輸入所要選擇內(nèi)容的序號(1-4): bb");scan f("%d", &a);switch(a)case 1:me nu _2();break;case 2:me nu _3();break;case 3:biao_1();break;case 4:exit(0);break;default :exit(0);getchar();getchar(); void menu _2(
4、)void sca n_1();void add_1();void rewrite_1();void delete_1();void seek_1(); int a;system("cls"); prin tf("t printf("t歡迎使用小區(qū)用戶管理系統(tǒng)*n"); (A 3 A) /n");-n");prin tf("t-prin tf("t-1.瀏覽用戶資料-n");prin tf("t-2.錄入用戶資料-n");prin tf("t-3.更改用戶資料-n&
5、quot;);prin tf("t-4.刪除用戶資料-n");prin tf("t-5.查找用戶資料-n");prin tf("t-n");prin tf("t-n");printf("t-0(n n )On ”);prin tf("tENDn");printf(”請輸入所要選擇內(nèi)容的序號(1-3): bb");scan f("%d",&a);switch(a)case 1:sca n_1();break;case 2:add_1();break;
6、case 3:rewrite_1();break;case 4:delete_1();break;case 5:seek_1();break;default:exit(O);void sca n_1()FILE *fp;char ch;if(fp=fope n("e:data.txt","r+")=NULL) prin tf("ca nnot ope n the file!"); exit(0);ch=fgetc(fp);while(ch!=EOF)putchar(ch);ch=fgetc(fp);fclose(fp);prin tf
7、("n");void add_1()FILE *fp;if(fp=fope n( ”e:data.txt”,”a”)=NULL) printf("文件不能打開/n”);exit(0);elseint i;i nt num;printf("輸入所要輸入數(shù)據(jù)的數(shù)目=");scan f("%d", &n um);for(i=2;i <nu m+2;i+)printf("編號:");scan f("%d",&Pi.a);printf("姓名:"); s
8、can f(”s”,Pi.mi ng);printf("項目:"); scan f("%s",Pi.xia ng);printf("已交:"); scan f("%d",&Pi.b);printf("已欠:"); scan f("%d",&Pi.c);fprin tf(fp,"%d %s %s %d %d",Pi.a,Pi.mi ng,Pi.xia ng,Pi.b,Pi.c);fprin tf(fp,"n");fclos
9、e(fp);void save in _1()int i;FILE *fp;fp=fope n("e:data.txt","r");for(i=0;i<3;i+)fscan f(fp,"%d%s%s%d%d",&Pi.a,Pi.mi ng,Pi.xia ng,&Pi.b,&Pi.c);fclose(fp); void rewrite_1()FILE *fp;void save in _1();if( (fp=fope n( "e:data.txt","a")=NUL
10、L)printf(" 文件不能打開/n”); exit(0);elseint i=0, num;save in _1();printf("輸入所要更改的編號bb");scan f("%d", &n um);while(Pi.a!=num)i+;prin tf(" 請輸入所要的新標號n");scan f("%d",&Pi-1.a);printf("請輸入所要的姓名n");scan f("%s",Pi-1.mi ng);printf("請輸入所
11、要的收費項目n");scan f("%s",Pi-1.xia ng);prin tf(" 請輸入所欠的物業(yè)費n");scan f("%d",&Pi-1.b);prin tf(" 請輸入已交的物業(yè)費n");scan f("%d",&Pi-1.c);fp=fope n("e:data.txt","w+");i=0;dofprintf(fp,"%d %s %s %d %d",Pi.a,Pi.ming,Pi.xiang
12、,Pi.b,Pi.c);i+;while(i<=2);fclose(fp); void delete_1()FILE *fp;void save in _1();int nu m,i=0;printf("請輸入所要刪除人的編號:bb");scan f("%d",&n um);save in _1();while(Pi.a!=num)i+;for(i;i<=5;i+)Pi.a=Pi+1.a;strcpy(Pi.mi ng,Pi+1.mi ng);strcpy(Pi.xia ng,Pi+1.xia ng);Pi.b=Pi+1.b;Pi.c
13、=Pi+1.c;fp=fope n( "e:data.txt","w");i=0;dofprin tf(fp,"%d %s %s %d %d",Pi.a,Pi.mi ng,Pi.xia ng,Pi.b,Pi.c); i+ ;while(i<=5);fclose(fp);void seek_1()void save in _1();int nu m,i=0;prin tf("請輸入所要查找的人的編號:bb");scan f("%d",&n um);save in _1();while
14、(i!=num)i+;prin tf("%d %s%s%d%d",Pi-1.a,Pi-1.mi ng,Pi-1.xia ng,Pi-1.b,Pi-1.c); void menu _3()void sca n_2();void add_2();void rewrite_1();void delete_2(); int a; system("cls");prin tf("t*歡迎使用物業(yè)收費管理系統(tǒng)*nprintf("t-(O O ?)n");prin tf("t-n");prin tf("t-n&
15、quot;);prin tf("t-1.瀏覽小區(qū)收費項目-n");prin tf("t-2.增加小區(qū)收費數(shù)目-n");prin tf("t-3.更改小區(qū)收費項目-n");prin tf("t-4.刪除小區(qū)收費項目-n");prin tf("t-n");prin tf("t-n");printf("t-(:O o O)n");prin tf("t-END-n");printf(”請輸入所要選擇內(nèi)容的序號(1-3): bb");s
16、can f("%d",&a);switch(a)case 1:sca n_2();break;case 2:add_2();break;case 3:rewrite_1();break;case 4:delete_2();break; default:exit(O); void sca n_2()FILE *fp;char ch;if(fp=fope n("e:data.txt","r+")=NULL) prin tf("ca nnot ope n the file!"); exit(0);ch=fgetc
17、(fp);while(ch!=EOF)putchar(ch); ch=fgetc(fp);fclose(fp); void add_2()int i,num;FILE *fp;if(fp=fope n("e:data.txt","a")=NULL)printf(”文件不能打開/n”);exit(O);elseprintf(”輸入所要輸入數(shù)據(jù)的數(shù)目=");scan f("%d", &n um);for(i=3;i <nu m+3;i+)printf("編號:”);scan f("%d"
18、;,&Pi.a);printf("姓名:");scan f("%s",&Pi.mi ng);printf("項目:"); scan f("%s",&Pi.xia ng);printf("已交:");scan f("%d",&Pi.b); printf("已欠:");scan f("%d",&Pi.c);fprin tf(fp,"%d %s %s %d %d",Pi.a,Pi.m
19、i ng,Pi.xia ng,Pi.b,Pi.c); fclose(fp);prin tf("n ”);/*void rewrite_2()FILE *fp;if(fp=fope n("e:data.txt","w")=NULL)printf(”文件不能打開/n”);exit(0);else int i,num;prin tf("輸入所要輸入數(shù)據(jù)的數(shù)目=");sca nf("%d",&n um);for(i=3;i <nu m+3;i+)printf("項目:");sca nf("%s",&Pi.xia ng);fprin tf(fp,"%s",Pi.xia ng);fprin tf(fp,"n"); fclose(fp);*/void dele
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 吉林2025年吉林省一汽總醫(yī)院招聘筆試歷年參考題庫附帶答案詳解
- 臺州浙江臺州路橋區(qū)招聘專職網(wǎng)格員5人筆試歷年參考題庫附帶答案詳解
- 南通2025年江蘇南通海安市教體系統(tǒng)招聘教師84人筆試歷年參考題庫附帶答案詳解
- 南充2025年四川南充市人大常委會辦公室下屬事業(yè)單位考調(diào)2人筆試歷年參考題庫附帶答案詳解
- 南京2025年江蘇南京市秦淮區(qū)教育局所屬學(xué)校招聘教師121人筆試歷年參考題庫附帶答案詳解
- 涼山2025下半年四川涼山美姑縣招聘初高中教師39人筆試歷年參考題庫附帶答案詳解
- 安全員A證考試試卷含答案詳解(滿分必刷)
- 新生兒沐浴技術(shù)操作并發(fā)癥的預(yù)防及處理流程
- 新《安全生產(chǎn)法》(完整版)測試題
- 安全員A證考試綜合檢測題型匯編【易錯題】附答案詳解
- GB/T 18724-2024印刷技術(shù)印刷品與印刷油墨耐各種試劑性的測定
- HG+20231-2014化學(xué)工業(yè)建設(shè)項目試車規(guī)范
- 嬰幼兒托育服務(wù)與管理專業(yè)-《嬰幼兒感覺統(tǒng)合訓(xùn)練》課程標準
- 老年口腔健康講座課件
- 卒中后認知障礙管理專家共識
- 南京科技職業(yè)學(xué)院單招職測參考試題庫(含答案)
- 客戶驗廠報告
- 開磷集團(電池級磷酸一銨)項目環(huán)評報告
- 電站組件清洗措施及方案
- 案例(母線PT反充電)
- 上海市歷年中考語文文言文閱讀試題45篇(含答案與翻譯)(截至2021年)
評論
0/150
提交評論