Forpersonal use only in study and research; not for commercial use
袂#include<stdio.h>
莂#include<string.h>
莈 | typedef | /*±£´æ¼Ç¼ÌõÊý½á¹¹Ìå*/ | struct | |
count{ | ||||
袆 | char name[10]; | |||
羀 | int num; |
螁}count;
膈
蚃typedefstruct st{
莃 charname[10];
膀 longNumber;
袈 intMath;
螄 intC;
蒁 intAmount;
蚀}st;
虿strecord[8];
袆countnum[1];
袃charfilename[10]={"0"};
聿charfilename2[10]={"0"};
荿intInputnum[8];
蚃
羂voidMainMenu(){ /*Ö÷²Ëµ¥*/
蒈 printf("\n\t\t\t\t** * * * * * * * *\n");
袅 printf("\t\t\t\t* Ö÷²Ëµ¥ *\n");
蚅 printf("\t\t\t\t*1. ´´½¨ÐÂÎļþ *\n");
肀 printf("\t\t\t\t*2. Ìí¼Ó¼Ç¼ *\n");
羈 printf("\t\t\t\t*3. ɾ³ý¼Ç¼ *\n");
薆 printf("\t\t\t\t*4. ÅÅÐò *\n");
螆 printf("\t\t\t\t*5. ²éѯ¼Ç¼ *\n");
蒂 printf("\t\t\t\t*6. Í˳ö *\n");
薁 printf("\t\t\t\t** * * * * * * * *\n");
莆}
薃
薁voidDelMenu(){ /*ɾ³ý²Ëµ¥*/
肁 printf("\n\t\t\t\t** * * * * * * * * * *\n");
肆 printf("\t\t\t\t* ɾ³ý²Ëµ¥ *\n");
薅 printf("\t\t\t\t*1. ѧºÅ²éѯɾ³ý *\n");
羃 printf("\t\t\t\t*2. ·µ»Øµ½Éϼ¶²Ëµ¥ *\n");
蒀 printf("\t\t\t\t** * * * * * * * * * *\n");
袇}
蚆
肂voidRankingMenu(){ /*ÅÅÐò²Ëµ¥*/
衿 printf("\n\t\t\t\t** * * * * * * * * * *\n");
薇 printf("\t\t\t\t* ÅÅÐò²Ëµ¥ *\n");
蒃 printf("\t\t\t\t*1. Êýѧ³É¼¨ÅÅÐò *\n");
蒄 printf("\t\t\t\t*2. CÓïÑԳɼ¨ÅÅÐò *\n");
荿 printf("\t\t\t\t*3. ×Ü·ÖÅÅÐò *\n");
芈 printf("\t\t\t\t*4. ·µ»Øµ½Éϼ¶²Ëµ¥ *\n");
蒅 printf("\t\t\t\t** * * * * * * * * * *\n");
薂}
螈
肈voidInquireMenu(){ /*²éѶ²Ëµ¥*/
薆 printf("\n\t\t\t\t** * * * * * * * * * *\n");
蚁 printf("\t\t\t\t* ²éѶ²Ëµ¥ *\n");
蒁 printf("\t\t\t\t*1. ѧºÅ²éѶ *\n");
螈 printf("\t\t\t\t*2. ÐÕÃû²éѶ *\n");
莄 printf("\t\t\t\t*3. Êýѧ³É¼¨²éѶ *\n");
羃 printf("\t\t\t\t*4. CÓïÑԳɼ¨²éѶ *\n");
袁 printf("\t\t\t\t*5. ×Ü·Ö²éѶ *\n");
蕿 printf("\t\t\t\t*6. ·µ»Øµ½Éϼ¶²Ëµ¥ *\n");
蒅 printf("\t\t\t\t** * * * * * * * * * *\n");
膁}
芀
肅 char
Inputfilename(){ /*ÊäÈëÎļþÃûͬʱ²ú
Éú¸¶±¾ÎļþÃû*/
蒆 charstr2[]={"B"};
蒄 printf("**ÇëÊäÈëÎļþÃû ** : ");
螀 scanf("%s",filename);
螅 getchar();
芄 strcpy(filename2,filename);
薂 strcat(filename2,str2);
腿}
蒆
莅 | /*¶ÁÈ¡Îĵµ*/ | FILE | |
*readfile(){ | |||
螁 | FILE *fp1; | ||
薈 | if((fp1=fopen(filename,"rb"))==NULL) | ||
芆 | {printf("\nÎļþ¶ÁÈ¡´íÎó!!\n"); | ||
莇 | fclose(fp1); | ||
肃 | } | ||
羈 | return(fp1); |
羇}
膄
膁FILE *foundfile(){
蚁 FILE *fp1;
/*н¨Îĵµ*/
螇 if((fp1=fopen(filename,"wb"))==NULL)
芅 {printf("\nÎļþ´´½¨´íÎó!!\n");
薄 fclose(fp1);
膀 }
蒇 return(fp1);
肃}
蚂
薀 | /*×·¼ÓÎĵµ*/ | FILE | |
*savefile(){ | |||
芈 | FILE *fp1; | ||
肄 | if((fp1=fopen(filename,"ab"))==NULL) | ||
螀 | {printf("\nÎļþ×·¼Ó´íÎó!!\n"); | ||
罿 | fclose(fp1); | ||
羈 | } | ||
膅 | return(fp1); |
膃}
荿
蝿intInputSave(){ /*Ìí¼ÓÊý¾Ý
*/
羃 inti=0,j;
芁 charch='y';
袈 while(ch!='w')
葿 {i=i+1;
肄 printf("\n**ÇëÊäÈëÐÕÃû(×Ö·ûÐÍ) ** :");
蚄 scanf("%s",record[i].name);
薁Loop1:printf("\n** ÇëÊäÈëѧºÅ(³¤ÕûÐÍ) ** :");
羅 scanf("%ld",&record[i].Number);
肅 if(i!=1)
螂for(j=1;j<i;j++)
羁 if(record[i].Number==record[j].Number)
蚆 {printf("\n\t¾¯¸æ!ÊäÈëÁ˶þ¸öͬÑùµÄѧºÅ!
µÚ%dÌõºÍµÚ%dѧºÅÏàͬ!\n",i,j);
袃 printf("\n\tÇëÖØÐÂÊäÈë!\n");
袀 gotoLoop1;
莀}
蒆Loop2:printf("\n** ÇëÊäÈëÊýѧ³É¼¨(ÕûÐÍ) ** :");
羄 scanf("%d",&record[i].Math);
芃 if(record[i].Math>100||record[i].Math<0)
蝿 {printf("\n\tÊäÈëµÄ·ÖÊý²»·þºÏʵ¼ÊÒªÇó!ÇëÖØмÈë!\n");
膆gotoLoop2;
羆 }
莁Loop3:printf("\n** ÇëÊäÈëCÓïÑԳɼ¨(ÕûÐÍ) ** :");
艿 scanf("%d",&record[i].C);
袇 if(record[i].C>100||record[i].C<0)
螃 {printf("\n\tÊäÈëµÄ·ÖÊý²»·þºÏʵ¼ÊÒªÇó!ÇëÖØмÈë!\n");
螃gotoLoop3;
蚈 }
蚇 record[i].Amount=record[i].Math+record[i].C;
袄 printf("\n'w'=½áÊø¼Èë 's'=ÖØмÈë´ËÌõ¼Ç¼'n'=ÏÂÒ»Ìõ : ");
袂 getchar();
/*³ÔµôÉÏÒ»¸ö»Ø³µ·û*/
莂 if((ch=getchar())=='s')
莈i=i-1;
袆 }
羀 return(i);
螁}
膈
蚃/*
莃 void ReadComputer(int i,FILE
*fp1){ (Îı¾·½Ê½)Êý¾ÝдÈë»úÆ÷
膀 intj;
袈 for(j=1;j<i+1;j++)
螄
fscanf(fp1,"%s,%ld,%d,%d,%d",record[j].name,&record[j].Number,&rec
ord[j].Math,&record[j].C,&record[j].Amount);
蒁}
蚀
虿 | void | SaveFile(int | i,FILE |
*fp1){ (Îı¾·½Ê½)Êý¾Ýдµ½Îļ
þÖÐ
袆 intj;
袃 for(j=1;j<i+1;j++)
聿
fprintf(fp1,"%s,%ld,%d,%d,%d",record[j].name,record[j].Number,reco
rd[j].Math,record[j].C,record[j].Amount);
荿}
蚃*/
羂
蒈void ReadComputer2(int i,FILE
*fp1){ /*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
袅 intj;
蚅 for(j=1;j<i+1;j++)
肀 if((fread(&record[j],sizeof(structst),1,fp1))!=1)
羈 {printf("\nÖ÷ÎļþÊý¾Ý¶ÁÈ¡´íÎó!\n");
薆 fclose(fp1);
螆 }
蒂}
薁
莆 | void | SaveFile2(int | i,FILE |
*fp1){ /*(2·½Ê½)Êý¾Ýдµ½ÎļþÖ
Ð*/
薃 intj;
薁 for(j=1;j<i+1;j++)
肁 if((fwrite(&record[j],sizeof(structst),1,fp1))!=1)
肆 {printf("\nÖ÷ÎļþÊý¾ÝдÈë´íÎó!\n");
薅 fclose(fp1);
羃 }
蒀}
袇 | /* | ************************************************************ |
************************************************************/
蚆 FILE
*readfile2(){ /*¶ÁÎļþ¸¶±¾
*/
肂 FILE*fp1;
衿 if((fp1=fopen(filename2,"rb"))==NULL)
薇 {printf("\n¸¶±¾Îļþ¶ÁÈ¡´íÎó!\n");
蒃 fclose(fp1);
蒄 }
荿 return(fp1);
芈}
蒅
薂 FILE
*foundfile2(){ /*н¨Îļþ¸
¶±¾*/
螈 FILE*fp1;
肈 if((fp1=fopen(filename2,"wb"))==NULL)
薆 {printf("\n¸¶±¾Îļþ´´½¨´íÎó!\n");
蚁 fclose(fp1);
蒁 }
螈 return(fp1);
莄}
羃
袁 FILE
*savefile2(){ /*×·¼ÓÎļþ¸
¶±¾*/
蕿 FILE*fp1;
蒅 if((fp1=fopen(filename2,"ab"))==NULL)
膁 {printf("\n¸¶±¾Îļþ×·¼Ó´íÎó!\n");
芀 fclose(fp1);
肅 }
蒆 return(fp1);
蒄}
螀
螅/*
芄void Additive2(int i,FILE
*fp1){ Êý¾ÝÓëÈ븶±¾Îļþ£¨Îı¾·½Ê½£©
薂 intj;
腿 charstr2={"0"};
蒆 if(strcmp(filenameF,str2)!=0)
莅 strcpy(num[0].name,filenameF);
螁 else
薈 strcpy(num[0].name,filenameA);
芆 num[0].num=i;
莇
肃 fprintf(fp1,"%s,%d",num[0].name,num[0].num);
羈 }
羇
膄 | int | ReadComputer2(FILE |
*fp1){ ¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨Îı¾·½Ê½
£©
膁 intj,k;
蚁
螇 fscanf(fp1,"%s,%d",num[0].name,&num[0].num);
芅 k=num[0].num;
薄 return(k);
膀}
蒇*/
肃
蚂 | void | Additive2Two(int | i,FILE |
*fp1){ /*Êý¾ÝдÈ븶±¾Îļþ£¨¶þ½øÖÆ·½Ê½
£©*/
薀 charstr2[]={"0"};
芈 if(strcmp(filename2,str2)!=0)
肄 strcpy(num[0].name,filename2);
螀 else
罿 strcpy(num[0].name,filename2);
羈 num[0].num=i;
膅 if((fwrite(&num[0],sizeof(structcount),1,fp1))!=1)
膃 {printf("\n¸¶±¾ÎļþÊý¾ÝдÈë´íÎó!\n");
荿 fclose(fp1);
蝿 }
羃}
芁
袈 | int | ReadComputer2Two(FILE |
*fp1){ /*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ
·½Ê½£©*/
葿 intj;
肄 if((fread(&num[0],sizeof(structcount),1,fp1))!=1)
蚄 {printf("\n¸¶±¾ÎļþÊý¾Ý¶ÁÈ¡´íÎó!\n");
薁 fclose(fp1);
羅 }
肅 j=num[0].num;
螂 return(j);
羁}
蚆 | /* | ************************************************************ |
************************************************************/
袃 void
Num_inquire(){ /*ѧºÅ²éÑ
¯*/
袀 | int num,j,time; | fp1=readfile(); |
莀 | FILE *fp1,*fp2; | |
蒆 |
/*¶ÁÈ¡Îĵµ*/
羄 fp2=readfile2();
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
芃 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
蝿 ReadComputer2(time,fp1);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
膆 fclose(fp1);fclose(fp2);
羆 printf("ÊäÈëѧºÅ:");
莁 scanf("%ld",&num);
艿 /*getchar();*/
袇 for(j=1;j<time+1;j++)
螃 {if(record[j].Number==num)
螃 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
蚈 }
蚇}
袄
袂 void
Name_inquire(){ /*ÐÕÃû²éÑ
¯*/
莂 | int j,time; | fp2=readfile2(); |
莈 | char Name[10]; | |
袆 | FILE *fp1,*fp2; | |
羀 | fp1=readfile(); | |
螁 |
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
膈 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
蚃 ReadComputer2(time,fp1);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
莃 fclose(fp1);fclose(fp2);
膀 printf("ÊäÈëÐÕÃû:");
袈 scanf("%s",Name);
螄 /*getchar();*/
蒁 for(j=1;j<time+1;j++)
蚀 {if(strcmp(Name,record[j].name)==0)
虿 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
袆 }
袃}
聿
荿 void
Math_inquire(){ /*Êýѧ²éÑ
¯*/
蚃 | int Math,j,time; | fp2=readfile2(); |
羂 | FILE *fp1,*fp2; | |
蒈 | fp1=readfile(); | |
袅 |
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
蚅 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
肀 ReadComputer2(time,fp1);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
羈 fclose(fp1);fclose(fp2);
薆 printf("ÊäÈëÊýѧ³É¼¨:");
螆 scanf("%d",&Math);
蒂 /*getchar();*/
薁 for(j=1;j<time+1;j++)
莆 {if(record[j].Math>=Math)
薃 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
薁 }
肁}
肆
薅 void
C_inquire(){ /*C²éѯ*
/
羃
蒀 | int C,j,time; | fp2=readfile2(); |
袇 | FILE *fp1,*fp2; | |
蚆 | fp1=readfile(); | |
艿 |
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
肇 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
螅 ReadComputer2(time,fp1);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
蚁 fclose(fp1);fclose(fp2);
蚂 printf("ÊäÈëCÓïÑԳɼ¨:");
薆 scanf("%d",&C);
薅 /*getchar();*/
蚃 for(j=1;j<time+1;j++)
螀 {if(record[j].C>=C)
羆 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
芆 }
螄
袈}
虿
羆 void
Amount_inquire(){ /*×Ü·Ö²é
ѯ*/
薁
芁 | int Amount,j,time; | fp2=readfile2(); |
聿 | FILE *fp1,*fp2; | |
螇 | fp1=readfile(); | |
蚃 |
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
荿 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
蒈 ReadComputer2(time,fp1);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
芃 fclose(fp1);fclose(fp2);
蚄 printf("ÊäÈë×Ü·Ö:");
蚂 scanf("%d",&Amount);
羇 /*getchar();*/
羃 for(j=1;j<time+1;j++)
蒂 {if(record[j].Amount>=Amount)
袀 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
莇 }
蚄}
薃 | /* | ************************************************************ |
************************************************************/
羈 void
Num_inquire_Del(){ /*ѧºÅ²éÑ
¯É¾³ý*/
螆 | char ch; | fp1=readfile(); |
蒄 | int num,j,k,time; | |
薄 | FILE *fp1,*fp2; | |
芁 |
/*¶ÁÈ¡Îĵµ*/
膅 fp2=readfile2();
/*¶ÁÎļþ¸¶±¾*/
膄 time=ReadComputer2Two(fp2);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
莂 ReadComputer2(time,fp1);/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
荿 | fclose(fp1);fclose(fp2); | Num:%3ld | Math:%3d | C:%3d |
衿 | printf("ÊäÈëѧºÅ:"); | |||
羅 | scanf("%ld",&num); | |||
蒃 | getchar(); | |||
螂 | for(j=1;j<=time;j++) | |||
莈 | if(record[j].Number==num) | |||
蚅 | {printf("\nName:%-10s |
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,record[j].C,record[j].Amount);
芀 | k=j; | ²»É¾³ý='n' ** : "); | fp1=foundfile(); | |
袀 | } | |||
螈 | printf("\n\t** | ɾ³ý='y' | ||
蒆 | if((ch=getchar())=='y') | |||
节 | { | |||
羈 | if(k==time) | |||
膇 | time=time-1; | |||
膆 | else for(j=k;j<time;j++) | |||
莃 | {record[j]=record[j+1]; | |||
莁 | time=time-1; | |||
薆 | } | |||
羆 |
/*н¨Îĵµ*/
膁 SaveFile2(time,fp1);
/*(2·½Ê½)Êý¾Ýдµ½ÎļþÖÐ*/
葿 fp2=foundfile2();
/*н¨Îļþ¸¶±¾*/
肆 Additive2Two(time,fp2);
/*Êý¾ÝÓëÈ븶±¾Îļþ£¨¶þ½øÖÆ·½Ê½£©*/
蚇printf("\nɾ³ý³É¹¦!¡¡Ä¿Ç°¹²ÓÐ%dÌõ¼Ç¼!\n",time);
节 fclose(fp1);fclose(fp2);
袁 }
蝿 elseprintf("\nûÓÐÖ´ÐÐɾ³ý²Ù×÷!\n");
膃 }
芃 /*************************************************************
************************************************************/
羀 void Math_ranking(int
i){ /*ÊýѧÅÅÐòº¯Êý*/
膈 intj,k;
袃 sttime;
肁 for(j=1;j<i;j++)
肈 for(k=1;k<=i-j;k++)
薈 if(record[k].Math>record[k+1].Math)
蚄
{time=record[k];record[k]=record[k+1];record[k+1]=time;}
膂 printf("\n");
蒁 for(j=1;j<i+1;j++)
羇 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
莄}
膃
蕿 void C_ranking(int
i){ /*CÅÅÐòº¯Êý*/
蒇 intj,k;
肅 sttime;
羁 for(j=1;j<i;j++)
羁 for(k=1;k<=i-j;k++)
袆 if(record[k].C>record[k+1].C)
袅
{time=record[k];record[k]=record[k+1];record[k+1]=time;}
肂 printf("\n");
肀 for(j=1;j<i+1;j++)
蕿 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
薅}
肄
膈 void Amount_ranking(int
i){ /*×Ü·ÖÅÅÐòº¯Êý*/
罿 intj,k;
莆 sttime;
袁 for(j=1;j<i;j++)
薀 for(k=1;k<=i-j;k++)
莈 if(record[k].Amount>record[k+1].Amount)
肆
{time=record[k];record[k]=record[k+1];record[k+1]=time;}
羂 printf("\n");
虿 for(j=1;j<i+1;j++)
袇 printf("\nName:%-10s Num:%3ld Math:%3d C:%3d
Amount:%3d\n",record[j].name,record[j].Number,record[j].Math,recor
d[j].C,record[j].Amount);
袆}
肄 | /* | ************************************************************ |
************************************************************/
肁main(){
芇 FILE*fp,*ffp;
薇 inttemp1=0,temp2=0,temp3;
袁 charch,location;
腿 MainMenu();
蚆 location='1';
肃 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
袂 while((ch=getchar())!='0')
芈 {if((ch=='6')&&(location=='1'))
膆 {getchar();
螄 printf("\n\n\t\t\t**'Y'=Ðø¼Ì 'n'=Í˳ö **\n");
羄 printf("\n\n\t\tINPUT:");
蚀 if((ch=getchar())=='n')
蝿{printf("\n\n\t\t\t ллÄúµÄʹÓÃ!");
薄 exit();
螁 break;
蝿}
芈 else{MainMenu();location='1';
芄 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
螃}
膁 }
蚈 if((ch=='1')&&(location=='1'))
肅{
袄 temp1=InputSave();
/*Ìí¼ÓÊý¾Ý*/
艿 getchar();
肇 printf("\t\t**'y'=±£´æ 'n'=²»±£´æ ** : ");
螅 if((ch=getchar())=='y')
蚁 {Inputfilename();
/*ÊäÈëÎļþÃûͬʱ²úÉú¸¶±¾ÎļþÃû*/
蚂 fp=foundfile();
/*н¨Îĵµ*/
薆 SaveFile2(temp1,fp);
/*(2·½Ê½)Êý¾Ýдµ½ÎļþÖÐ*/
薅 | fclose(fp); | ffp=foundfile2(); |
蚃 |
/*(¿ª´ò·½Ê½'н¨')н¨Îļþ¸¶±¾*/
螀 Additive2Two(temp1,ffp);
/*н¨¸¶±¾ÎļþÊý¾Ý£¨Îı¾·½Ê½£©*/
膀fclose(ffp);
薀printf("±£´æÁË%dÌõ¼Ç¼!\n",temp1);
肈 }
肃 elseprintf("\t ûÓб£´æ!\n");
袃 temp1=0;temp2=0;
芀MainMenu();location='1';
袅printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
蒅 continue;
莃}
羁
袇 if((ch=='2')&&(location=='1'))
薃{getchar();
螂 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû 'n'=ÊäÈëÐÂÎļþÃû
**: ");
蒇 | if((ch=getchar())=='y') | fp=savefile(); |
羈 |
/*×·¼ÓÎĵµ*/
羆 | else | {Inputfilename(); |
/*ÊäÈëÎļþÃûͬʱ²úÉú¸¶±¾ÎļþÃû*/
膁 | } | fp=savefile(); | temp1=InputSave(); |
芇 | |||
螆 |
/*Ìí¼ÓÊý¾Ý*/
肄 | temp3=temp1; | SaveFile2(temp1,fp); |
蚁 |
/*(2·½Ê½)Êý¾Ýдµ½ÎļþÖÐ*/
羈 | fclose(fp); | ffp=readfile2(); |
螇 |
/*¶ÁÎļþ¸¶±¾*/
膂 temp2=ReadComputer2Two(ffp);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨Îı¾·½Ê½£©*/
肀 | fclose(ffp); | ffp=foundfile2(); |
螈 | temp1=temp1+temp2; | |
袈 |
/*н¨Îļþ¸¶±¾*/
薅 Additive2Two(temp1,ffp);
/*н¨¸¶±¾ÎļþÊý¾Ý£¨Îı¾·½Ê½£©*/
蒀fclose(ffp);
蒈 printf("\nÌí¼ÓÀ-%dÌõÊý¾Ý!¹²±£´æ%dÌõÊý¾Ý!\n",temp3,temp1);
蚆 temp1=0;temp2=0;
蚃MainMenu();location='1';
膃 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
腿 continue;
螇}
肆
薂 if((ch=='3')&&(location=='1'))
罿{DelMenu();location='2';
蒄 printf("\nÇëÊäÈëÑ¡Ïî1 - 3 (µ±Ç°ÔÚɾ³ý²Ëµ¥):");
膄 while((ch=getchar())!='0'){
肂 if((ch=='1')&&(location=='2'))
蚀{getchar();
薆 printf("\n\t\t **ÏÖÔÚλÖÃÔÚɾ³ý²Ëµ¥ -
ѧºÅɾ³ý**\n");
节 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
蒁 | if((ch=getchar())=='y') | {} |
蒀 |
/*×·¼ÓÎĵµ*/
蚇 | else | Inputfilename(); |
/*ÊäÈëÎļþÃûͬʱ²úÉú¸¶±¾ÎļþÃû*/
蚅 Num_inquire_Del();
/*ѧºÅ²éѯɾ³ý*/
袀 DelMenu();location='2';
膀 printf("\nÇëÊäÈëÑ¡Ïî1 - 3 (µ±Ç°ÔÚɾ³ý²Ëµ¥):");
蒅 continue;
螃}
芀if((ch=='2')&&(location=='2'))
羁 {MainMenu();location='1';
蒆 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
膅 break;
羃}
莇 }
薇}
芄
蒃 if((ch=='4')&&(location=='1'))
膇{RankingMenu();location='3';
莅 printf("\nÇëÊäÈëÑ¡Ïî1 - 4 (µ±Ç°ÔÚÅÅÐò²Ëµ¥):");
莂 while((ch=getchar())!='0'){
袂 if((ch=='1')&&(location=='3'))
袈 {getchar();
莆 printf("\n\t\t **ÏÖÔÚλÖÃÔÚÅÅÐò²Ëµ¥ -
ÊýѧÅÅÐò**\n");
螅 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
芁 | if((ch=getchar())=='y') | {} |
蚈 |
/*×·¼ÓÎĵµ*/
蒇 | else Inputfilename(); | fp=readfile(); |
袃 |
/*¶ÁÈ¡Îĵµ*/
蚁 ffp=readfile2();
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
荿 temp1=ReadComputer2Two(ffp);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
芅 fclose(ffp);
芅 ReadComputer2(temp1,fp);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
膀 fclose(fp);
腿 Math_ranking(temp1);
/*ÊýѧÅÅÐòº¯Êý*/
莆 temp1=0;temp2=0;
莄 RankingMenu();location='3';
袃 printf("\nÇëÊäÈëÑ¡Ïî1 - 4 (µ±Ç°ÔÚÅÅÐò²Ëµ¥):");
衿 continue;
莈}
蒂if((ch=='2')&&(location=='3'))
芃 {getchar();
薀 printf("\n\t\t **ÏÖÔÚλÖÃÔÚÅÅÐò²Ëµ¥ -
CÓïÑÔÅÅÐò**\n");
膅 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
袄 | if((ch=getchar())=='y') | {} |
蚂 |
/*×·¼ÓÎĵµ*/
莀 | else Inputfilename(); | fp=readfile(); |
芆 |
/*¶ÁÈ¡Îĵµ*/
羃 ffp=readfile2();
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
肂 temp1=ReadComputer2Two(ffp);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
肁 fclose(ffp);
芈 ReadComputer2(temp1,fp);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
芅 | fclose(fp); | C_ranking(temp1); |
薁 |
/*ÊýѧÅÅÐòº¯Êý*/
袁 temp1=0;temp2=0;
肅 RankingMenu();location='3';
蒄 printf("\nÇëÊäÈëÑ¡Ïî1 - 4 (µ±Ç°ÔÚÅÅÐò²Ëµ¥):");
羀 continue;
莇}
膆if((ch=='3')&&(location=='3'))
薂 {getchar();
莀 printf("\n\t\t **ÏÖÔÚλÖÃÔÚÅÅÐò²Ëµ¥ -
×Ü·ÖÅÅÐò**\n");
肈 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
膈 | if((ch=getchar())=='y') | {} |
袄 |
/*×·¼ÓÎĵµ*/
肃 | else Inputfilename(); | fp=readfile(); |
螈 |
/*¶ÁÈ¡Îĵµ*/
羅 ffp=readfile2();
/*(¿ª´ò·½Ê½'¶Á'**'ÒýÓöÁÎļþÃû')¶ÁÎļþ¸¶±¾*/
肃 temp1=ReadComputer2Two(ffp);
/*¶Á³ö¸¶±¾ÖеÄÊý¾Ý£¨¶þ½øÖÆ·½Ê½£©*/
蒂 fclose(ffp);
薈 ReadComputer2(temp1,fp);
/*(2·½Ê½)Êý¾ÝдÈë»úÆ÷*/
肇 fclose(fp);
莅 Amount_ranking(temp1);
/*ÊýѧÅÅÐòº¯Êý*/
羂 temp1=0;temp2=0;
艿 RankingMenu();location='3';
膈 printf("\nÇëÊäÈëÑ¡Ïî1 - 4 (µ±Ç°ÔÚÅÅÐò²Ëµ¥):");
蒃 continue;
莁}
聿if((ch=='4')&&(location=='3'))
袅 {MainMenu();location='1';
袆 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):");
螁 break;
螀}
羇}
羄 }
膀
薀if((ch=='5')&&(location=='1'))
肈{InquireMenu();location='4';
肃 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):");
袃 while((ch=getchar())!='0'){
芀 if((ch=='1')&&(location=='4'))
袅{getchar();
蒅 printf("\n\t\t **ÏÖÔÚλÖÃÔÚ²éѯ²Ëµ¥ -
ѧºÅ²éѯ**\n");
莃 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
羁 | if((ch=getchar())=='y') | {} |
袇 |
/*×·¼ÓÎĵµ*/
薃 | else Inputfilename(); | Num_inquire(); |
螂 |
/*ѧºÅ²éѯ*/
蒇 InquireMenu();location='4';
羈 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):");
羆 continue;
膁}
芇 if((ch=='2')&&(location=='4'))
螆{getchar();
肄 printf("\n\t\t **ÏÖÔÚλÖÃÔÚ²éѯ²Ëµ¥ -
ÐÕÃû²éѯ**\n");
蚁 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
羈 | if((ch=getchar())=='y') | {} |
螇 |
/*×·¼ÓÎĵµ*/
膂 elseInputfilename();
肀 Name_inquire();
/*ÐÕÃû²éѯ*/
螈 InquireMenu();location='4';
袈 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):");
薅 continue;
蒀}
蒈 if((ch=='3')&&(location=='4'))
蚆{getchar();
蚃 printf("\n\t\t **ÏÖÔÚλÖÃÔÚ²éѯ²Ëµ¥ -
Êýѧ³É¼¨²éѯ**\n");
膃 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
腿 | if((ch=getchar())=='y') | {} |
螇 |
/*×·¼ÓÎĵµ*/
肆 | else Inputfilename(); | Math_inquire(); |
薂 |
/*Êýѧ²éѯ*/
罿 InquireMenu();location='4';
蒄 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):");
膄 continue;
肂}
蚀 if((ch=='4')&&(location=='4'))
薆{getchar();
节 printf("\n\t\t **ÏÖÔÚλÖÃÔÚ²éѯ²Ëµ¥ -
C³É¼¨²éѯ**\n");
蒁 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
蒀 | if((ch=getchar())=='y') | {} |
蚇 |
/*×·¼ÓÎĵµ*/
蚅 | else Inputfilename(); | C_inquire(); |
袀 |
/*C²éѯ*/
膀 InquireMenu();location='4';
蒅 printf("\nÇëÊäÈëÑ¡Ïî1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):");
螃 continue;
芀}
羁 if((ch=='5')&&(location=='4'))
蒆{getchar();
膅 printf("\n\t\t **ÏÖÔÚλÖÃÔÚ²éѯ²Ëµ¥ -
×Ü·Ö²éѯ**\n");
羃 printf("\n\t ** 'y'=ʹÓõ±Ç°ÎļþÃû
'n'=ÊäÈëÐÂÎļþÃû** : ");
莇 | if((ch=getchar())=='y') | {} |
薇 |
/*×·¼ÓÎĵµ*/
芄 | else Inputfilename(); | Amount_inquire(); |
蒃 |
/*×Ü·Ö²éѯ*/
膇 InquireMenu();location='4';
莅 | } | printf("\nÇëÊäÈëÑ¡Ïî 1 - 6 (µ±Ç°ÔÚ²éѯ²Ëµ¥):"); |
莂 | continue; | |
袂 | } | |
袈 | if((ch=='6')&&(location=='4')) | |
莆 | {MainMenu();location='1'; | |
螅 | printf("\nÇëÊäÈëÑ¡Ïî 1 - 6 (µ±Ç°ÔÚÖ÷²Ëµ¥):"); | |
芁 | break; | |
蚈 | } | |
蒇 | } | |
袃 | ||
蚁 | } |
}
以下无正文
仅供个人用于学习、研究;不得用于商业用途。
Forpersonal use only in study and research; not for commercial use.
仅供个人用于学习、研究;不得用于商业用途。
Nurfür den persönlichen für Studien, Forschung, zu kommerziellenZwecken verwendet werden.
Pourl 'étude et la recherche uniquement à des fins personnelles; pas àdes fins commerciales.
仅供个人用于学习、研究;不得用于商业用途。
толькодля людей, которые используются дляобучения, исследований и не должныиспользоваться
вкоммерческих целях.