當前位置:首頁 » 編程語言 » c語言網吧管理系統設
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

c語言網吧管理系統設

發布時間: 2023-01-22 09:05:29

① 大神求助~~~~求一份用c語言編寫的網吧計費管理系統,

/*應該建立有頭結點的鏈表,否則,如果刪除的數據剛好是第一個結點時,麻煩就大了。代碼改動處較多,已經過不完全測試,可以運行。*/#include#includestructstu{intnum;charname[20];floatsorce;structstu*next;};voidoutput_sc(structstu*head){structstu*p;for(p=head->next;p;p=p->next)printf("%d%s%f\n",p->num,p->name,p->sorce);printf("\n");}structstu*creat(){structstu*head,*p;inti,n,len;len=sizeof(structstu);printf(":");scanf("%d",&n);printf("pleaseinputstudentsdetials\n");head=p=(structstu*)malloc(len);for(i=0;inext=(structstu*)malloc(len);scanf("%d%s%f",&p->next->num,p->next->name,&p->next->sorce);p=p->next;}p->next=NULL;return(head);}intdel(structstu*head){structstu*p,*q;intnum;printf("請輸入要刪除的學號:");scanf("%d",&num);if(head->next==NULL){printf("此鏈表為空\n");return0;}p=head;while(p->next!=NULL){if(p->next->num==num){q=p->next;p->next=q->next;free(q);return1;}p=p->next;}printf("未找到相關信息\n");return0;}voidoutput_df(structstu*head){structstu*p;FILE*fp;if((fp=fopen("D:\\data.txt","at+"))==NULL){printf("該文件不存在\n");exit(0);}for(p=head->next;p!=NULL;p=p->next)fprintf(fp,"%d%s%f\n",p->num,p->name,p->sorce);fclose(fp);}voiddf_sc(structstu*head){structstus;FILE*fp;fp=fopen("D:\\data.txt","r");if(fp==NULL){printf("無法打開文件\n");exit(0);}while(!feof(fp)){fscanf(fp,"%d%s%f",&s.num,s.name,&s.sorce);printf("%d%s%f\n",s.num,s.name,s.sorce);}fclose(fp);}voidmain(){structstu*head;while(1){intn;printf("\t***********************************************\n");printf("\t\t歡迎使用學生成績管理系統\n");printf("\t\t1.creat2.del\n");printf("\t\t3.out-screen4.out-datafaile\n");printf("\t\t5.datafaile-screen6.exit\n");printf("\t***********************************************\n");printf("\t\tpleaseinputselct1--6\n");printf("Selectplease:");scanf("%d",&n);switch(n){case1:head=creat();break;case2:del(head);break;case3:output_sc(head);break;case4:output_df(head);break;case5:df_sc(head);break;case6:exit(0);break;}}}

② 請問可以在網吧用C語言編程么具體怎麼做我剛開始學C語言,沒什麼基礎,高一學生,要學會有難度

可以,不過最好還是在自己機器上。因為開發軟體在安裝的時候,都會往系統里寫很多信息,如果在網吧的,被還原了那下次又得重新裝。
個人比較喜歡C語言,如果你不嫌麻煩的話,下一個幾百M大小的vc6.0隨身帶著,用的時候就安裝一下,要麼你下個TC2.0 這個比較小,不過界面不怎麼人性化,基本是鍵盤操作。
任何一種編程語言,特別是像C這樣對演算法要求比較高的語言,都要有嚴謹的邏輯思維能力。個人推薦學C打基礎。

③ 求個c++網吧管理系統代碼

#include<iostream>

#include<fstream>

usingnamespace

std;

classdevice

{public:

charname[10];//

物品名稱

charcolor[10];//

物品顏色

charaddress[50];//

廠商地址

charfactory[50];//

生產廠商

chartype[20];//

物品型號

intyear,month,day;//

出廠日期

intnumber;//

物品數量

device(){}//

構造函數

~device(){}//

析構函數

virtualvoidpay(){}//

設置價格函數

};

classTV:virtualpublicdevice

{public:

TV(){}

voidset1(char*n,char*c,char*a,char*f,char*t,inty,intm,intd,intnn)

{strcpy(name,n);

strcpy(color,c);

strcpy(address,a);

strcpy(factory,f);

strcpy(type,t);

year=y;

month=m;

day=d;

number=nn;

}

voidpay(){price1=3000;}//

普通電視機售價

floatprice1;

};

classDVD:virtualpublicdevice

{public:

DVD(){}

voidset2(char*n,char*c,char*a,char*f,char*t,inty,intm,intd,intnn)

{strcpy(name,n);

strcpy(color,c);

strcpy(address,a);

strcpy(factory,f);

strcpy(type,t);

year=y;

month=m;

day=d;

number=nn;

}

voidpay(){price2=2000;}//DVD

售價

floatprice2;

};

classTV_DVD:publicTV

,publicDVD

{public:

TV_DVD(){}

voidset3(char*n,char*c,char*a,char*f,char*t,inty,intm,intd,intnn)

{strcpy(name,n);

strcpy(color,c);

strcpy(address,a);

strcpy(factory,f);

strcpy(type,t);

year=y;

month=m;

day=d;

number=nn;

}

voidpay(){price=(2000+3000)*80/100;}//

DVD

的普通電視機售價

floatprice;

};

TVt1[20];DVDd1[20];TV_DVDtd1[20];

staticintk(0),k1(0),k2(0);

voidmain()//

主函數

{voidcaidan();

caidan();

}

voidcaidan()

{voidemployw();//

信息錄用

voidaddw();//

添加物品信息

voidshown();//

顯示物品信息

voidselectw();//

刪除物品信息

④ C語言程序 如何編寫管理系統

C語言編程的規則
C語言源程序的編程語法歸納如下:
1,強制性規則
1,一個C語言源程序必須有且只有一個MAIN函數.
2,函數名後必須緊跟圓括弧對,函數體放在右圓括弧")"後的花括弧對"{}"中.
3,每個程序體(包括函數的函數體,含有多條語句的選擇結構和循環結構中的語句序列)必須用一對花括弧括起來.
4,文件包含預處理命令,#INCLUDE<*.H應置於源程序的開始位置.
5,語句未尾必須有分號,而預處理命令和函數首部的未尾及右花括弧之後不要分號.
6,同一字母大,小寫意義不同,關鍵字和標准庫函數名必須用小寫.
7,變數必須先定義,後使用
8,除已有明顯間隔符外,標識符,關鍵字之間必須有至少一個空格9,註解必須包含在"/* */符號之間

⑤ 網路域名管理系統(C語言程序設計)

域名注冊 企業郵局 通通網路伺服器租用 託管 月付450元起

⑥ 如何用c語言編寫網吧管理系統

單靠C是不可能寫出管理系統的,要好多別的語言的支持,你去網站下點別的語言程序,整和一下比較好.