| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 602 人关注过本帖
标题:[求助]工资管理程序修改
只看楼主 加入收藏
kimomo
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-6-20
收藏
 问题点数:0 回复次数:1 
[求助]工资管理程序修改
用TC运行有26个错误,各位帮忙修改以下,谢谢了



{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fmodern\fprq6\fcharset134 \'cb\'ce\'cc\'e5;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang2052\f0\fs20 */\par
\par
/* \'ce\'aa\'c1\'cb\'b5\'f7\'d3\'c3FILE\'b5\'c8\'ba\'af\'ca\'fd */\par
#include "stdio.h"\par
\par
#include "conio.h"\par
\par
/* \'ce\'aa\'c1\'cb\'b5\'f7\'d3\'c3atof()\'b5\'c8\'ba\'af\'ca\'fd */\par
#include "stdlib.h"\par
\par
#define TRUE 1\par
\par
\par
/* \'bd\'e1\'b9\'b9\'cc\'e5\'c9\'f9\'c3\'f7 */\par
struct zhigong\par
\{\par
int month;\par
float id;\par
float jbgz;\par
float jt;\par
float gt;\par
float bt;\par
float ft;\par
float jtbt;\par
float yfs;\par
float fz;\par
float cx;\par
float hf;\par
float grsds;\par
float yks;\par
float sfs;\par
\par
\};\par
\par
/* \'bd\'a8\'c1\'a250\'b8\'f6\'d4\'aa\'cb\'d8\'b5\'c4\'bd\'e1\'b9\'b9\'cc\'e5\'ca\'fd\'d7\'e9 */\par
struct zhigong zg[50];\par
\par
\par
\par
/* \'bd\'a8\'c1\'a2\'bd\'e1\'b9\'b9\'cc\'e5\'b1\'e4\'c1\'bf */\par
struct zhigong zgone;\par
\par
/* \'d6\'b0\'d4\'b1\'c1\'d0\'b1\'ed\'d6\'d0\'b5\'c4\'ca\'fd\'c1\'bf */\par
int n=0;\par
\par
/* \'bb\'f1\'b5\'c3\'d7\'d6\'b7\'fb\'b4\'ae */\par
char numstr[50];\par
\par
main()\par
\{\par
\par
\par
\par
char ch;\par
n=0;\par
\par
/*rfile(); \'ca\'b9\'d3\'c3\'ba\'f3\'c6\'f4\'b6\'af\'b3\'cc\'d0\'f2\'ca\'b1\'cf\'b5\'cd\'b3\'bb\'e1\'d7\'d4\'b6\'af\'bc\'d3\'d4\'d8\'bc\'cd\'c2\'bc*/\par
\par
\par
while(TRUE)\par
\{\par
\par
printf("\\n");\par
printf("===========================================\\n");\par
printf("Welcome!Please choice(1-6) : +\\n");\par
printf("1.Add one infomation +\\n");\par
printf("2.Delete one infomation +\\n");\par
printf("3.Modify one infomation +\\n");\par
printf("4.Print out by id +\\n");\par
printf("5.Print out all +\\n");\par
printf("6.Save date +\\n");\par
printf("7.Load date +\\n");\par
printf("8.Exit +\\n");\par
printf("===========================================\\n");\par
ch=getche();\par
\par
\par
\par
switch(ch)\par
\{\par
case '1':addone();break;\par
case '2':delone();break;\par
case '3':modone();break;\par
case '4':idone();break;\par
case '5':listall();break;\par
case '6':wfile();break;\par
case '7':rfile();break;\par
case '8':return;\par
default:printf("Sorry,please choice again!\\n");\par
\par
\par
\}\par
\par
\}\par
\par
\}\par
\par
\par
\par
/*\'bc\'c6\'cb\'e3\'b8\'f6\'c8\'cb\'cb\'f9\'b5\'c3\'cb\'b0*/\par
float tgrsds(float m)\par
\{\par
float sui1,sui2,sui3;\par
float tmp;\par
sui1=0;sui2=0;sui3=0;\par
\par
if(m>=5000)\par
\{\par
sui1=(m-5000)*0.2;\par
sui2=(5000-1000)*0.1;\par
sui3=(1000-800)*0.05;\par
\}\par
else if(m>=1000 && m<5000)\par
\{\par
sui2=(m-1000)*0.1;\par
sui3=(1000-800)*0.05;\par
\}\par
else if(m>=800 && m<1000)\par
\{\par
sui3=(m-800)*0.05;\par
\}\par
\par
tmp=sui1+sui2+sui3;\par
\par
return(tmp);\par
\par
\par
\}\par
\par
\par
/* \'cc\'ed\'bc\'d3\'d6\'b0\'b9\'a4\'b5\'c4\'b9\'a4\'d7\'ca\'d0\'c5\'cf\'a2 */\par
addone(void)\par
\{\par
\par
\par
printf("\\n");\par
\par
printf("Record NO. %d \\n",n+1);\par
\par
printf("Please put in month: \\n");\par
gets(numstr);\par
zg[n].month=atoi(numstr);\par
\par
printf("Please put in zhigongbianhao: \\n");\par
gets(numstr);\par
zg[n].id=atof(numstr);\par
\par
printf("Please put in jibengongzi: \\n");\par
gets(numstr);\par
zg[n].jbgz=atof(numstr);\par
\par
printf("Please put in jintie: \\n");\par
gets(numstr);\par
zg[n].jt=atof(numstr);\par
\par
printf("Please put in gangtie: \\n");\par
gets(numstr);\par
zg[n].gt=atof(numstr);\par
\par
printf("Please put in butie: \\n");\par
gets(numstr);\par
zg[n].bt=atof(numstr);\par
\par
printf("Please put in fangtie: \\n");\par
gets(numstr);\par
zg[n].ft=atof(numstr);\par
\par
printf("Please put in jiaotongbutie: \\n");\par
gets(numstr);\par
zg[n].jtbt=atof(numstr);\par
\par
zg[n].yfs=(zg[n].jbgz)+(zg[n].jt)+(zg[n].gt)+(zg[n].bt)+(zg[n].ft)+(zg[n].jtbt);\par
\par
printf("Please put in fangzu: \\n");\par
gets(numstr);\par
zg[n].fz=atof(numstr);\par
\par
printf("Please put in chuxu: \\n");\par
gets(numstr);\par
zg[n].cx=atof(numstr);\par
\par
printf("Please put in huifei: \\n");\par
gets(numstr);\par
zg[n].hf=atof(numstr);\par
\par
zg[n].grsds=tgrsds(zg[n].yfs);\par
\par
zg[n].yks=(zg[n].fz)+(zg[n].cx)+(zg[n].hf)+(zg[n].grsds);\par
\par
zg[n].sfs=(zg[n].yfs)-(zg[n].yks);\par
\par
n++;\par
\par
\}\par
\par
\par
/*\'c9\'be\'b3\'fd\'b8\'f6\'c8\'cb\'bc\'cd\'c2\'bc*/\par
delone(void)\par
\{\par
struct zhigong tmp[50];\par
float zhigongid;\par
int j,k;\par
int flagfind;\par
flagfind=0;\par
k=0;\par
\par
\par
printf("\\n Please put in zhigongbianhao: \\n");\par
gets(numstr);\par
zhigongid=atof(numstr);\par
for(j=0;j<=n;j++)\par
\{\par
if(zg[j].id==zhigongid)\par
\{\par
flagfind=1;\par
\}\par
else\par
\{\par
\par
tmp[k]=zg[j];\par
k++;\par
\}\par
\}\par
\par
if(flagfind==1)\par
\{\par
for(j=0;j<=(n-1);j++)\par
\{\par
zg[j]=tmp[j];\par
\}\par
printf("\\n Record deleted! \\n");\par
n=n-1;\par
\}\par
else\par
\{\par
printf("\\n Record not found! \\n");\par
\}\par
\par
\par
return;\par
\}\par
\par
\par
/*\'d0\'de\'b8\'c4\'b8\'f6\'c8\'cb\'bc\'cd\'c2\'bc*/\par
modone(void)\par
\{\par
float zhigongid;\par
int j;\par
int flagfind;\par
flagfind=0;\par
\par
\par
printf("\\n Please put in zhigongbianhao: \\n");\par
gets(numstr);\par
zhigongid=atof(numstr);\par
\par
for(j=0;j<=n;j++)\par
\{\par
if(zg[j].id==zhigongid)\par
\{\par
printf("NO.:%d\\n",j);\par
printf("month:%d\\n",zg[j].month);\par
printf("zhigongbianhao%10.0f\\n",zg[j].id);\par
printf("jibengongzi:%10.2f\\n",zg[j].jbgz);\par
\par
printf("Please put in jibengongzi: \\n");\par
gets(numstr);\par
zg[j].jbgz=atof(numstr);\par
\par
printf("jintie:%10.2f\\n",zg[j].jt);\par
\par
printf("Please put in jintie: \\n");\par
gets(numstr);\par
zg[j].jt=atof(numstr);\par
\par
\par
printf("gangtie:%10.2f\\n",zg[j].gt);\par
\par
printf("Please put in gangtie: \\n");\par
gets(numstr);\par
zg[j].gt=atof(numstr);\par
\par
printf("butie:%10.2f\\n",zg[j].bt);\par
\par
printf("Please put in butie: \\n");\par
gets(numstr);\par
zg[j].bt=atof(numstr);\par
\par
printf("fangtie:%10.2f\\n",zg[j].ft);\par
\par
printf("Please put in fangtie: \\n");\par
gets(numstr);\par
zg[j].ft=atof(numstr);\par
\par
printf("jiaotongbutie:%10.2f\\n",zg[j].jtbt);\par
\par
printf("Please put in jiaotongbutie: \\n");\par
gets(numstr);\par
zg[j].jtbt=atof(numstr);\par
\par
zg[j].yfs=(zg[j].jbgz)+(zg[j].jt)+(zg[j].gt)+(zg[j].bt)+(zg[j].ft)+(zg[j].jtbt);\par
\par
\par
printf("fangzu:%10.2f\\n",zg[j].fz);\par
\par
printf("Please put in fangzu: \\n");\par
gets(numstr);\par
zg[j].fz=atof(numstr);\par
\par
printf("chuxu:%10.2f\\n",zg[j].cx);\par
\par
printf("Please put in chuxu: \\n");\par
gets(numstr);\par
zg[j].cx=atof(numstr);\par
\par
printf("huifei:%10.2f\\n",zg[j].hf);\par
\par
printf("Please put in huifei: \\n");\par
gets(numstr);\par
zg[j].hf=atof(numstr);\par
\par
zg[j].grsds=tgrsds(zg[j].yfs);\par
\par
\par
zg[j].yks=(zg[j].fz)+(zg[j].cx)+(zg[j].hf)+(zg[j].grsds);\par
\par
\par
zg[j].sfs=(zg[j].yfs)-(zg[j].yks);\par
\par
flagfind=1;\par
\}\par
else\par
\{\par
flagfind=0;\par
\par
\}\par
\}\par
\par
if(flagfind==0)printf("\\n Can not find record! \\n");\par
\par
return;\par
\}\par
\par
\par
/*\'cb\'e6\'bb\'fa\'b4\'d3\'c4\'da\'b4\'e6\'d6\'d0\'b2\'e9\'d5\'d2\'bc\'cd\'c2\'bc\'b8\'f9\'be\'ddid*/\par
idone(void)\par
\{\par
float zhigongid;\par
int j;\par
int flagfind;\par
flagfind=0;\par
\par
\par
printf("\\n Please put in zhigongbianhao: \\n");\par
gets(numstr);\par
zhigongid=atof(numstr);\par
\par
for(j=0;j<=n;j++)\par
\{\par
if(zg[j].id==zhigongid)\par
\{\par
printf("\\n %d record found! \\n |",j+1);\par
printf("month:%d |",zg[j].month);\par
printf("zhigongbianhao%10.0f |",zg[j].id);\par
printf("jibengongzi:%10.2f |",zg[j].jbgz);\par
printf("jintie:%10.2f |",zg[j].jt);\par
printf("gangtie:%10.2f |",zg[j].gt);\par
printf("butie:%10.2f |",zg[j].bt);\par
printf("fangtie:%10.2f |",zg[j].ft);\par
printf("jiaotongbutie:%10.2f |",zg[j].jtbt);\par
printf("yingfashu:%10.2f |",zg[j].yfs);\par
printf("fangzu:%10.2f |",zg[j].fz);\par
printf("chuxu:%10.2f |",zg[j].cx);\par
printf("huifei:%10.2f |",zg[j].hf);\par
printf("gerensuodeshui:%10.2f |",zg[j].grsds);\par
printf("yingkoushu:%10.2f |",zg[j].yks);\par
printf("shifashu:%10.2f\\n",zg[j].sfs);\par
\par
flagfind=1;\par
\}\par
else\par
\{\par
flagfind=0;\par
\par
\}\par
\}\par
\par
if(flagfind==0)printf("\\n Can not find record! \\n");\par
\par
return;\par
\}\par
\par
\par
\par
\par
\par
/* \'ca\'e4\'b3\'f6\'b5\'b1\'d4\'c2\'c8\'ab\'cc\'e5\'d6\'b0\'b9\'a4\'b5\'c4\'b9\'a4\'d7\'ca\'d0\'c5\'cf\'a2 */\par
listall(void)\par
\{\par
int j;\par
if(n<1)\par
\par
\{\par
printf("\\n No record! \\n");\par
\}\par
else\par
\{\par
for(j=0;j<n;j++)\par
\{\par
printf("\\n NO:%d |",j+1);\par
printf("month:%d |",zg[j].month);\par
printf("zhigongbianhao%10.0f |",zg[j].id);\par
printf("jibengongzi:%10.2f |",zg[j].jbgz);\par
printf("jintie:%10.2f |",zg[j].jt);\par
printf("gangtie:%10.2f |",zg[j].gt);\par
printf("butie:%10.2f |",zg[j].bt);\par
printf("fangtie:%10.2f |",zg[j].ft);\par
printf("jiaotongbutie:%10.2f |",zg[j].jtbt);\par
printf("yingfashu:%10.2f |",zg[j].yfs);\par
printf("fangzu:%10.2f |",zg[j].fz);\par
printf("chuxu:%10.2f |",zg[j].cx);\par
printf("huifei:%10.2f |",zg[j].hf);\par
printf("gerensuodeshui:%10.2f |",zg[j].grsds);\par
printf("yingkoushu:%10.2f |",zg[j].yks);\par
printf("shifashu:%10.2f\\n",zg[j].sfs);\par
\}\par
\}\par
\par
\}\par
\par
\par
/* \'b0\'d1\'cb\'f9\'d3\'d0\'bc\'cd\'c2\'bc\'b4\'d3\'c4\'da\'b4\'e6\'d6\'d0\'d0\'b4\'b5\'bd\'b4\'c5\'c5\'ccgongzi.rec\'d6\'d0 */\par
wfile(void)\par
\{\par
FILE *fptr;\par
\par
printf("\\n Saving date... \\n");\par
\par
if(n<1)\par
\{\par
printf("\\n No record! \\n");\par
return;\par
\}\par
if((fptr=fopen("gongzi.rec","wb"))==NULL)\par
printf("Can not open file gongzi.rec! \\n");\par
else\par
\{\par
fwrite(zg,sizeof(zg[0]),n,fptr);\par
fclose(fptr);\par
printf("File of %d records written! \\n",n );\par
\}\par
\par
\par
\}\par
\par
\par
/* \'b0\'d1\'cb\'f9\'d3\'d0\'bc\'cd\'c2\'bc\'b4\'d3\'b4\'c5\'c5\'ccgongzi.rec\'b6\'c1\'b5\'bd\'ca\'fd\'d7\'e9gz\'d6\'d0 */\par
rfile(void)\par
\{\par
FILE *fptr;\par
\par
n=0;\par
\par
printf("\\n Loading date... \\n");\par
\par
if((fptr=fopen("gongzi.rec","rb"))==NULL)\par
printf("Can not open file gongzi.rec! \\n");\par
else\par
\{\par
while(fread(&zg[n],sizeof(zg[n]),1,fptr)==1)\par
n++;\par
fclose(fptr);\par
printf(" Total %d records read! \\n",n);\par
\}\par
\par
\}\par
\par
}
搜索更多相关主题的帖子: 管理程序 工资 
2007-06-20 15:19
ibiancheng
Rank: 1
等 级:新手上路
帖 子:148
专家分:0
注 册:2007-4-3
收藏
得分:0 

感觉挺乱的...呵呵


执著的信念,坚定的自信,勤奋的努力才是通向成功的捷径! !!
2007-06-20 19:39
快速回复:[求助]工资管理程序修改
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017147 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved