| C语言-编程实例-职工管理系统(系统密码:123456 修改数据密码:12345) |
|
|
C语言-编程实例-职工管理系统(系统密码:123456 修改数据密码:12345)
#include"sio.h" #include"sing.h" void shuchu(void); void shuju(void),jisuan(void),chaxun(void); void renyuan(void),tuichu(void),xiugai(void); int s=0,cs=0,us=3; char x[1][6]={'1','2','3','4','5','6'}; char yyy[1][6],kk;
char y1,y; /*选择*/ char n; int i,j,k=0,l,jb=1000; /*变量定义:n选择 i,j 循环变量 l 选项*/ int sum[10],koukuan[10],jiangjin[10],nianlin[10],ygh[10]; /* 数据录入*/ char *xingming[10]={"王凯","白永胜","肖佑","孙莉","袁伟","郭妍","周鑫","李小虎","马亮","张学丰"}; char xingbie[10][1];
main() {
aa: clrscr(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t 输入次数为三次!"); printf("\n\t\t\t 输入完按回键结束!"); printf("\n\t\t\t\t 请输入密码:"); for(s=0;s<6;s ) { yyy[0][s]=getch(); if((yyy[0][s]>='0')&&(yyy[0][s]<='9')||(yyy[0][s]>='a')&&(yyy[0][s]<='z')||(yyy[0][s]>='A')&&(yyy[0][s]<='Z')) { printf("*"); } else goto bb; } kk=getch(); bb: for(s=0;s<6;s ) { if(x[0][s]!=yyy[0][s]) { cs ; if(cs>=3) { printf("\n\n\n\t\t\t Sorry!!! 您的输入次数已到!\n"); printf("\t\t\t 不能进入系统!!!"); getch(); clrscr(); exit(); } printf("\n\n\n\t\t\t 密码错误请重新输入!"); printf("\n\t\t\t 您还有%i次机会!",--us); getch(); clrscr(); goto aa; } }
clrscr(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n"); printf("\t\t说明:【使用前必需先录入数据,否则功能无法实现!】"); y=getch(); clrscr(); jm: printf(" \n\t* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 工资管理系统 * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * * * * * * * * * * * * * * * * * * * * * *\n"); printf(" \t*\t * * * * * * * * * * * * * * * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 1.数据录入 * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 2.工资计算 * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 3.查询统计… * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 4.职工基本资料查询… * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 5.查看所有记录 * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 6.修改数据(需要权限密码) * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * 7.退出系统 * *\n"); printf(" \t*\t * * *\n"); printf(" \t*\t * * * * * * * * * * * * * * * *\n"); printf(" \t* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n"); printf(" \t 【制作人:王凯】\n"); printf("\t\t\t\t请输入选择1--7/?"); scanf("%c",&n);
if (n=='1')/*录入*/
{ clrscr(); shuju(); printf("按任意键退出?"); y1=getchar(); if(y1!='') goto jm; }
else if(n=='2')/*计算*/ { clrscr(); jisuan(); clrscr(); goto jm; } else if(n=='3')/*查询统计*/ { clrscr(); chaxun(); clrscr(); goto jm; } else if(n=='4')/*查询*/ { clrscr(); renyuan(); goto jm; } else if(n=='5')/*输出所有记录*/ { clrscr(); shuchu(); goto jm; } else if(n=='6')/*修改*/ { clrscr(); xiugai(); goto jm; } else if(n=='7')/*退出*/ { oo: clrscr(); for(i=1;i<13;i ) { printf("\n"); } for(i=1;i<14;i ) { printf("\t"); } printf(" 确认退出吗Y/N?"); y1=getchar(); if(y1=='y'||y1=='Y') { clrscr(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t谢谢使用!"); getch(); clrscr(); exit(); } else if(y1=='n'||y1=='N') { clrscr(); goto jm; } else { goto oo; } } else { clrscr(); goto jm; } }
void shuju() /*数据录入*/ { int i,j; char kk; for(i=0;i<10;i ) { prin [1] [2] [3] [4] 下一页
|