91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

C語言編寫的簡單員工管理系統,適合初學者練手

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
string?sex_name[2]={“男““女“};
string?duty_name[]={“普通職員““生產組長““車間主管““部門經理““董事長“};

struct?worker_information
{

????char?name[20];???//職工姓名
????int?sex;????//職工性別1是男,2是女
????int?date_birth_year;
????int?date_birth_month;???//出生年月
????int?date_work_year;
????int?date_work_month;????//工作年月
????char?edu_backgroud[20];???//學歷
????int?duty;???????????//職務序號
????char?address[40];????????//住址
????char?phone[20];???????//電話號碼
};
void?save(int?nstruct?worker_information?work[])
{
????int?i;
????FILE*fp;
????if?((fp=fopen(“employee.txt““w“))==NULL)??/*創建文件并判斷是否能打開*/
????{
????????printf?(“cannot?open?file\n“);

????}
????for?(i=0;?i????????if?(fwrite(&work[i]sizeof(struct?worker_information)1fp)!=1)
????????????printf(“file?write?error\n“);
????fclose(fp);
}

int?load(struct?worker_information?work[])??/*導入函數*/
{
????FILE*fp;
????int?i=0;
????if((fp=fopen(“employee.txt““r“))==NULL)
????{
????????printf?(“cannot?open?file\n“);

????}
????else
????{
????????do
????????{
????????????fread(&work[i]sizeof(struct?worker_information)1fp);
????????????i++;
????????}
????????while(feof(fp)==0);
????}
????fclose(fp);
????return(i-1);
}
void?clear_work(struct?worker_information?work[]int?sum)
{
??if(sum==0){
????????cout<<“員工信息表為空“<????return;?//員工信息表不存在
??}
??else
????{
?????save(0work);??//將空表載入文件中
????}
}

void?Get(int?iint?sumstruct?worker_information?work[])
{
?if(sum==0){
??????cout<<“員工信息表為空“<????}?//員工信息表不存在
?else
????{
????????cout<<“**************員工“<?????cout<<“姓名:“<?????cout<<“性別:“<?????cout<<“出生年月:“<?????cout<<“工作年月:“<?????cout<<“學歷:“<?????cout<<“職務:“<?????cout<<“家庭地址:“<?????cout<<“電話號碼:“<?????cout<<“***********************************“<????}

}
void?insert_work(int?iint?sumstruct?worker_information?t[])
{
?????for(int?j=sum;j>i;j--)
??????t[j]=t[j-1];
????cout<<“員工“<????cout<<“請輸入新增職工的姓名“<????scanf(“%s“t[i].name);
????cout<<“請輸入新增職工的性別選項:序號1為男性序號2為女性“<????cin>>t[i].sex;
????cout<<“請輸入新增職工的出生年份“<????cin>>t[i].date_birth_year;
???????cout<<“請輸入新增職工的出生月份“<????cin>>t[i].date_birth_month;
????cout<<“請輸入新增職工的工作年份“<????cin>>t[i].date_work_year;
????cout<<“請輸入新增職工的工作月份“<????cin>>t[i].date_work_month;
????cout<<“請輸入新增職工的學歷:學歷范圍(初中高中本科研究生)“<???scanf(“%s“t[i].edu_backgroud);
????cout<<“請輸入新增職工的職務序號:(1.普通職員2.生產組長3.車間主管4.部門經理5.董事長)“<????cin>>t[i].duty;

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1240??2020-07-08?20:11??簡單職工管理系統\employee.txt
?????目錄???????????0??2020-12-03?20:31??簡單職工管理系統\源程序\
?????文件????????1240??2020-07-09?08:10??簡單職工管理系統\源程序\employee.txt
?????文件?????1726676??2020-07-09?08:39??簡單職工管理系統\源程序\簡單職工管理系統.exe
?????文件???????15706??2020-07-09?08:39??簡單職工管理系統\簡單職工管理系統.cpp
?????文件?????????368??2020-12-03?20:32??簡單職工管理系統\說明文件.txt
?????目錄???????????0??2020-12-03?20:32??簡單職工管理系統\

評論

共有 條評論