diff --git a/运动会计分.c b/运动会计分.c index 633f418..f425b1e 100644 --- a/运动会计分.c +++ b/运动会计分.c @@ -1,39 +1,58 @@ -#include -#include -#include -#include -struct achievement//ʾɼĽṹ -{char schoolname[20];//ѧУ - int schoolnumber;//ѧУ - int l;// - char name[20];//˶Ա - int mark;// - int mscore;;//ܷ - int wscore ;//Ůܷ - int sum;//ѧУܷ - int range[];//ѧУ -}; -struct subject//ʾĿĽṹ -{int subnum;//Ŀ - int subkind;//Ŀ - char subname[20];//Ŀ -}; -int main() -printf("***********************************************\n"); -printf("** 1.ʼϢ **\n"); -printf("** 2.ȷȡ **\n"); -printf("** 3.дĿ˶ԱϢ **\n"); -printf("** 4.ѯѧУϢͱĿϢ **\n"); -printf("** 5.˳ **\n"); -printf("***********************************************\n"); -int m,n,w;//n-ѧУ m-ӾĿ w-ŮӾĿ -printf("ѧУ\n"); -scanf("%d",&n); -printf("ӾĿ\n"); -scanf("%d",&m); -printf("ŮӾĿ\n"); -scanf("%d",&w); -printf("ȡ\n"); -scanf("%d",&l); -while(l!=3||l!=5) -printf("!"); +int main() +{ FILE *fp; + + int choice; + int flag1=1,flag2=1; + system("cls"); + do + { + printf("\n*************************************************************\n"); + printf("\n** ˶Ʒϵͳ **\n"); + printf("\n** 1.¼Ϣ **\n"); + printf("\n** 2.ȡϢ **\n"); + printf("\n** 3.ʾϢ **\n"); + printf("\n** 4.ѯϢ **\n"); + printf("\n** 5.˳ **\n"); + printf("\n*************************************************************\n"); + printf("\n\nʾѡ:"); + scanf("%d",&choice); + if(choice==1) + flag1=0; + else + if((fp=fopen("sportsdata.txt","r"))!=NULL ) + flag2=0; + else + { + system("cls"); + printf("ûϢ¼Ϣ!\n"); + } + }while(flag1&&flag2); + switch(choice) + { + case 1: + printf("\n==========Ϣ========\n"); + input(); + write(); + printf("==========ϢѴ뵵========="); + main(); + case 2: + read(); + write; + break; + case 3: + printf("===========Ϣ==========\n"); + if(flag1) + read(); + output(); + main(); + case 4: + printf("===========ѯϢ==========\n"); + if(flag1) + read(); + chaxun(); + main(); + case 5: + printf("\nллʹ"); exit(0); + default: + printf("ʾѡ\n"); exit(0); + }}