From 56dfb991ae0734ccd383c02c7ecee7a9f38bfb77 Mon Sep 17 00:00:00 2001 From: 556 <18408200125@stu.hut.edu.cn> Date: Wed, 9 Jan 2019 19:43:45 +0800 Subject: [PATCH] first commit --- Untitled1.exe | Bin 106893 -> 106893 bytes 工作量统计.c | 243 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 243 insertions(+) create mode 100644 工作量统计.c diff --git a/Untitled1.exe b/Untitled1.exe index 1547bc75af2a42596d4f4abd084de9cea12f8eb8..2de3c66d3577afcc974951b8724e993ec93867c4 100644 GIT binary patch delta 24 gcmeA@%+`CDZ9)grsyh?A{Fs>K8gFgA#khF^0Efv77XSbN delta 24 gcmeA@%+`CDZ9)f=;q8fCeoS35jkmVmV%)p{0EJTvA^-pY diff --git a/工作量统计.c b/工作量统计.c new file mode 100644 index 0000000..ca44c44 --- /dev/null +++ b/工作量统计.c @@ -0,0 +1,243 @@ +#include "stdio.h" +#include "stdlib.h" +#define FILENAME "worker.bin" +#define N 20 +/******************************************************* + +*******************************************************/ +struct worker +{ +int number; /**/ +int counts; /**/ +int grade; /**/ +}; +/******************************************************* +ʾ˵ +*******************************************************/ +void xinxi() +{ +printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); +printf("+ ְͳϵͳ +\n"); +printf("+ +\n"); +printf("+ 1. ְϢ +\n"); +printf("+ +\n"); +printf("+ 2. +\n"); +printf("+ +\n"); +printf("+ 3. +\n"); +printf("+ +\n"); +printf("+ 4. ְŽϢɾ +\n"); +printf("+ +\n"); +printf("+ 5. +\n"); +printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"); +} +/******************************************************* +ϢʾĻ +*******************************************************/ +readFromFile(struct worker w[]) +{ +FILE *fp=NULL; +int i=0; +fp=fopen(FILENAME,"rb"); /*ļ*/ +if(fp!=NULL) +{ +while(!feof(fp)) /*ļжѧ*/{ +if(i>=N) +break; +if(fread(w+i,sizeof(w),1,fp)==1) +i++; +} +fclose(fp); +} +return i; +} +/******************************************************* +:ְϢ +*******************************************************/ +int f(struct worker w[],int length) +{ +int i=length; +while(i=length) +printf("Ų:\n"); +printf("빤:"); +scanf("%d",&number); +} +} +//////////////////////////////////////////////////////////////////////////////// +/* С򲢱 *///////////////////////////////////////////////////////////////////////////////// +void sortCounts(struct worker w[],int length) +{ +int i=0,j=0,k=0; +struct worker s; +for(i=0;i0) +w[0].grade =1; +for(i=1;i0) +{ while(i