first commit

master
GLY 6 years ago
parent 7d61e33cd1
commit b45dd32fdc

Binary file not shown.

@ -0,0 +1,353 @@
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
int i=1;
struct staffsinfor
{
char staffnums[100];
char name[100];
char sex[100];
char studyF[100];
char homedress[100];
char money[100];
char phonenum[100];
};
void input(struct staffsinfor staffs[]){
int j;
two :system("cls");
printf("\t\t\t\t您在进行的是信息录入!\t\t\t已有人数%d(最多50人)\n\n\n",i);
if(i==50)
{
MessageBox(NULL,"人数已满!","系统提示",MB_OK);
return 0;
}
printf("\t\t\t请输入姓名\n");
gets(staffs[i].name);
printf("\t\t\t请输入职工号\n");
gets(staffs[i].staffnums);
printf("\t\t\t请输入性别\n");
gets(staffs[i].sex);
printf("\t\t\t请输入学历\n");
gets(staffs[i].studyF);
printf("\t\t\t亲输入工资\n");
gets(staffs[i].money);
printf("\t\t\t请输入住址\n");
gets(staffs[i].homedress);
printf("\t\t\t请输入电话\n");
gets(staffs[i].phonenum);
j=MessageBox(NULL,"是否确定?","系统提示",MB_YESNO);
if(j==6)
{
MessageBox(NULL,"录入成功","系统提示",MB_OK);
i++;
j=MessageBox(NULL,"是否继续录入?","系统提示",MB_YESNO);
if(j==6)
goto two;
}
else
{
MessageBox(NULL,"请重新录入","系统提示",MB_OK);
goto two;
}
}
void look(struct staffsinfor staffs[]){
int j=i;j--;char o;
three :
system("cls");
printf("\t\t\t\t您在进行的是浏览名单!\n\n\n");
if(j==0)
{
MessageBox(NULL,"未找到名单信息!","系统提示",MB_OK);
return 0;
}
printf("\t\t\t\tA.单个浏览\t\tB.总览");
o=getch();
if(o=='A')
{
system("cls");
printf("\t\t\t姓名:\n\t\t\t\t\t\t\t%s",staffs[j].name);
printf("\n\t\t\t职工号:\n\t\t\t\t\t\t\t%s",staffs[j].staffnums);
printf("\n\t\t\t性别:\n\t\t\t\t\t\t\t%s",staffs[j].sex);
printf("\n\t\t\t学历:\n\t\t\t\t\t\t\t%s",staffs[j].studyF);
printf("\n\t\t\t工资:\n\t\t\t\t\t\t\t%s",staffs[j].money);
printf("\n\t\t\t家庭住址:\n\t\t\t\t\t\t\t%s",staffs[j].homedress);
printf("\n\t\t\t电话号码:\n\t\t\t\t\t\t\t%s",staffs[j].phonenum);
printf("\n\n\n\t\t\t\t\t\t按A和D切换名单\n\t\t\t\t\t\t按BackSpace退回菜单");
o=getch();
if(o=='A')
{
if(j==1)
{system("cls");
printf("这已经是第一个了");
system("pause");
goto three;
}
j--;
goto three;
}
if(o=='D')
{
if(j==i&&j!=i)
{system("cls");
printf("这是最后一个了");
system("pause");
goto three;
}
j++;
goto three;
}
if(o==8)
return 0;
}
if(o=='B')
{ system("cls");
printf("职工号 姓名 性别 学历 工资 电话号码 家庭住址\n");
int p;
for(p=1;p<i;p++)
{
printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\n",staffs[p].staffnums,staffs[p].name,staffs[p].sex,staffs[p].studyF,staffs[p].phonenum,staffs[p].homedress);
system("pause");
}
}
}
void cha(struct staffsinfor staffs[]){
char a;char name[100];int o;
system("cls");
printf("\t\t\t\t管理菜单\t\t\t\t\n");
printf("**********************************************************************\n\n\n");
printf("\t\t\t\tA.按职工好查询\t\t\t\t\n\n");
printf("\t\t\t\tB.按姓名查询\t\t\t\t\n\n");
printf("\t\t\t\t\t\t\t\t\n\n");
printf("\t\t\t\t\t按BackSpace返回上一页\n\n\n\n\n");
printf("**********************************************************************\n");
a=getch();
if(a=='A')
{
four :
system("cls");
printf("\t\t\t\t您在进行的是信息录入!\t\t\t\n\n\n");
printf("请输入职员职工号\n");
gets(name);
for(o=0;o<i;o++)
{
if(strcmp(name,staffs[o].name)==0)
{
printf("\t\t\t姓名:\n\t\t\t\t\t\t\t%s",staffs[o].name);
printf("\n\t\t\t职工号:\n\t\t\t\t\t\t\t%s",staffs[o].staffnums);
printf("\n\t\t\t性别:\n\t\t\t\t\t\t\t%s",staffs[o].sex);
printf("\n\t\t\t学历:\n\t\t\t\t\t\t\t%s",staffs[o].studyF);
printf("\n\t\t\t工资:\n\t\t\t\t\t\t\t%s",staffs[o].money);
printf("\n\t\t\t家庭住址:\n\t\t\t\t\t\t\t%s",staffs[o].homedress);
printf("\n\t\t\t电话号码:\n\t\t\t\t\t\t\t%s",staffs[o].phonenum);
break;
}
}
system("pause");
a=MessageBox(NULL,"是否修改信息","系统提示",MB_YESNO);
if(a==6)
{
six :
system("cls");
printf("\n\t\t\t\t请选择要修改的信息");
printf("\t\1.姓名\t2.职工号\t3.性别\t4.工资\t5.家庭住址\t6.学历\t7.电话号码");
a=getch();
if(a==1)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==2)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==3)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==4)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==5)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==6)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
if(a==7)
{
printf("原姓名:%s\n",staffs[o].name);
printf("请输入新姓名:");
char ms[100];
gets(ms);
strcpy(staffs[o].name,ms);
int q; q=MessageBox(NULL,"确认更改?","系统提示",MB_YESNO);
if(q==6)
MessageBox(NULL,"修改成功","系统提示",MB_OK);
else
goto six;
}
}
else
goto four;
}
if(a=='B');
}
void shanchu(struct staffsinfor staffs[]){
seven :
system("cls");
int j;
printf("\t\t\t\t您在进行的是删除名单!\n\n\n");
printf("已有名单:");
//这里是全部人的数据,并要有序号。
printf("请选择要删除人的序号");
scanf("%d",&j);
int o;
for(o=0;o<i;o++)
{
if(o==j)
{
system("cls");
printf("以下是你选择的人的信息\n");
printf("\t\t\t姓名:\n\t\t\t\t\t\t\t%s",staffs[j].name);
printf("\n\t\t\t职工号:\n\t\t\t\t\t\t\t%s",staffs[j].staffnums);
printf("\n\t\t\t性别:\n\t\t\t\t\t\t\t%s",staffs[j].sex);
printf("\n\t\t\t学历:\n\t\t\t\t\t\t\t%s",staffs[j].studyF);
printf("\n\t\t\t工资:\n\t\t\t\t\t\t\t%s",staffs[j].money);
printf("\n\t\t\t家庭住址:\n\t\t\t\t\t\t\t%s",staffs[j].homedress);
printf("\n\t\t\t电话号码:\n\t\t\t\t\t\t\t%s",staffs[j].phonenum);
int q;
q=MessageBox(NULL,"确认删除?","系统提示",MB_YESNO);
if(q==6)
{
int p;
for(p=j;p<i;p++)
{
/* staffs[p].name=staffs[p+1].name;
staffs[p].staffnums=staffs[p+1].staffnums;
//其余的也更过来。。。。
*/}
i--;
goto seven;
}
}
}
}
int main()
{
char a;struct staffsinfor staffs[50];
/*职工信息管理系统设计最多2人
使
1
2()
3
4
5()*/
one :
system("cls");
printf("\t\t\t\t管理菜单\t\t\t\t\n");
printf("**********************************************************************\n\n\n");
printf("\t\t\t\tA.录入信息\t\t\t\t\n\n");
printf("\t\t\t\tB.浏览名单\t\t\t\t\n\n");
printf("\t\t\t\tC.查询信息\t\t\t\t\n\n");
printf("\t\t\t\tD.删除信息\t\t\t\t\n\n");
printf("\t\t\t\t\t按BackSpace返回上一页\n\n\n");
printf("\t\t\t\t\tBy--罗丁,高论域\n\n");
printf("**********************************************************************\n");
a=getch();
if(a=='A')
{
input(staffs);
goto one;
}
else if(a=='B')
{
look(staffs);
goto one;
}
else if(a=='C')
{
goto one;
}
else if(a=='D')
{
}
else
{
printf("输入错误!");
system("pause");
goto one;
}
return 0;
}

Binary file not shown.

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="课设" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/课设" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/课设" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="main.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="main.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="11921" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
Loading…
Cancel
Save