动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > C/C++教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ C/C++教程 ]的信息

本月文章推荐
.C++ Builder 初学问与答(六).
.数据结构学习(C++)之双向链表.
.图形与动画-03.
.C++程序设计中的多态技术研究.
.PE文件格式详解(3).
.C++中对浮点数的格式化显示.
.C++词汇解析集锦 编程开发人员必.
.浅谈C++函数的参数.
.VC++中的Progress控件的使用.
.如何用VC实现软件注册.
.C语言编程常见问题解答之程序的编.
.用Delphi实现图像放大镜.
.C++运算符重载函数基础及其值返回.
.用C++代码建立和压缩ACCESS数据库.
.C++数据结构学习:递归(1).
.猜数游戏.
.C语言库函数(G类字母)-5.
.解析C语言中的sizeof.
.高质量C++/C编程指南 --&nb.
.24点扑克牌游戏.

简单的职工管理系统(V1.1修改版)内含中文注释

发表日期:2008-3-8 |


/*------------------------------------------------------------------------
 * filename - workmanagerment.c
 *
 * written by
 *        沈豪杰(01213229)&&王鹏(01213208)
 *-----------------------------------------------------------------------*/ /*[]---------------------------------------------------[]*/
/*                         */
/* Turbo C Run workmanagerment.c- Version 1.1      */
/*                         */
/*                         */
/* Copyright (c) 2003 6 28 by shj and wp       */
/* All Rights Reserved.                */
/*                         */
/*[]---------------------------------------------------[]*/
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#define maxworker 100 FILE *fp;  /*定义全局变量fp,指向数据库文件 worker.txt*/ strUCt date{      /*日期的结构,用于存储工人的生日,工作日期等*/
  int year;
  int month;
  int day;
};
struct address {  /*地址的结构, 用于存储工人的地址*/
  char province[10];
  char city[10];
  char street[20];
};
struct WORKER {       /*工人的资料总结构*/
 char name[20];
 enum {male,female}sex;
 struct date birthday;
 enum {elesch,middle,high,university,other}rofs;
 struct date workday;
 int workeri;
 char position[20];
 struct address addr;
 int workerj;
 char tel[13];
 };
/*程序的初始化函数,用于从数据库中读出现存的资料到内存中*/
data_load(int *i,struct WORKER *p){
 char c;
 long int k;
 fp=fopen("worker.txt","r");
 if(!fp){fopen("worker.txt","w+");*i=0;}
 else{
 for((*i)=0;(*i)<maxworker;(*i)++){
  if(feof(fp)) return;
  c=fgetc(fp);
  if(c==EOF) return;
  fflush(stdin);
  k=*i;
  fseek(fp,k*sizeof(struct WORKER),SEEK_SET);
  fread(&p[*i],sizeof(struct WORKER),1,fp);
  }
 }
fclose(fp);
}
/*添加一个工人的资料*/
void add(int *i,struct WORKER *profile){
 char add_name[20],add_position[20],add_addr_province[20],add_addr_city[20],add_addr_street[30],add_tel[13];
 int add_birthday_year,add_birthday_month,add_birthday_day,add_workday_year,add_workday_month,add_workday_day;
 int add_sex,add_rofs;
 enum {false,true}status;
 status=false;
 printf("\n\tNow add NO. %d worker's profile\n",*i+1);  /*以下是处理输入的循环,可能有些繁杂,希望高手给指点一下
  其中status是个flag,用于指定是否有输错的地方,假如有的话,
  马上跳的最初的提示。
 */  while(status==false){
  printf("Enter the name of the worker:");
  scanf("%s",add_name);
     if(strlen(add_name)==0 strlen(add_name)>20){
         status=false;puts("input error,name cannot over 8 character or less than 0 character!");
         continue;
     }
     else
        status=true;
  printf("Enter the gender of worker:(1=>female,0=>male)");
  scanf("%d",&add_sex);
     if(add_sex!=0 && add_sex!=1){
         status=false;puts("only 0 or 1 can be accepted!");
         continue;
     }
     else
        status=true;
  printf("Enter the birthday of worker:\n");
  printf("\tYear:");
  scanf("%4d",&add_birthday_year);
     if(add_birthday_year>9999 add_birthday_year<0){
         status=false;puts("input error,the year of birthday cannot more than 9999 or less than 0!");
         continue;
      }
     else
        status=true;
printf("\tMonth:");
  scanf("%2d",&add_birthday_month);
     if(add_birthday_month>12 add_birthday_month<1){
         status=false;puts("input error,the month of birthday cannot be more than 12 or less than 1");
         continue;
      }
     else
        status=true;
printf("\tDay:");
  scanf("%2d",&add_birthday_day);
     if(add_birthday_day>31 add_birthday_day<1){
         status=false;puts("input error,the year of birthday cannot be more than 31 or less than 1!");
         continue;
      }
     else
        status=true;
  printf("Enter the workday of worker:\n");
  printf("\tYear:");
  scanf("%4d",&add_workday_year);
     if(add_workday_year>9999 add_workday_year<0){
         status=false;puts("input error,the year of workday cannot more than 9999 or less than 0!");
         continue;
      }
     else
        status=true;
printf("\tMonth:");
  scanf("%2d",&add_workday_month);
     if(add_workday_month>12 add_workday_month<1){
         status=false;puts("input error,the month of workday cannot be more than 12 or less than 1");
         continue;
      }
     else
        status=true;
printf("\tDay:");
  scanf("%2d",&add_workday_day);
     if(add_workday_day>31 add_workday_day<1){
         status=false;puts("input error,the year of workday cannot be more than 31 or less than 1!");
         continue;
      }
     else
        status=true;
[1] [2] [3] [4] [5] [6] 
上一篇:简单飘雪程序 人气:367
下一篇:More Effective C++:理解new和delete 人气:491
浏览全部C/C++的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-10-10 企业网站智能管理系统(TZIMS) v6
2008-10-10 拓文asp.net网站内容管理系统 v6
2008-10-10 动网论坛PHP版 v2.0++ Build 081
2008-10-10 免费时代CMS v5.0
2008-10-10 wodig第四季中文DIGG社区 v4.1 b
2008-10-10 老Y文章管理系统 v2.2 bulid 081
2008-10-10 魔法盒动感相册 ASP+SQL版 v2.0
2008-10-10 Asoft签到管理系统 v3.0 Pack1
2008-10-10 哥特人音乐网潮流留言本 v1.1
2008-10-11 联系人分组工具 v1.1 中文破解版
2008-10-11 FaceMelter变脸 v2.0 汉化破解版
2008-10-11 PathTracker道路跟踪仪 v1.2 破解
2008-10-11 Rooms手机聊天室 v0.6.7 破解版
2008-10-11 RemoteDesktop远程桌面 v1.0 破解
2008-10-11 ProRemote远程调音台 v1.0.1 破解
2008-10-11 PicShare照片共享 v1.0.0 破解版
2008-10-11 Photogene照片编辑器 v1.5 汉化破
2008-10-11 WriteRoom共享文档 v1.0 破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | 广告代码 | js/vbs加密 | md5加密 | 进制转换 | UTF-8 转换工具 | Html转换js | Html转换asp | Html转换php | Html转换perl
实用工具:汉字翻译拼音 | 拼音字典 | 符号对照表 | 个税计算 | 实时汇率查询换算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 | 国家代码与域名缩写 | 文字加密解密 | 健康查询 | 万年历 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵
SEO対策 中国語教室 ホームページ作成