=fopen("D:\\小区管理\\收费管理.txt","w+");}elseР{printf("收费名称收费金额收费单位收费周期");Рwhile(!feof(fp)){ fscanf(fp,"%20%d%20s%16s",&charge[i].name,&charge[i].much,&charge[i].unit,&charge[i] .cycle);Р printf("\t%-20s%-d\t\t%-20s\t%-16s\n",charge[i].name,charge[i].much,charge[i].unit,charge[i].cycle);s=s+charge[i].much; i++;}Р printf("\t收费总金额为:%d\n",s);}Рrepeat1:printf("1、添加收费项目 2、查找收费项目 3、按收费金额排序 4、删除收费项目 0、返回上级目录\n");Р?scanf("%d",&a);Р?switch(a)Р?{Р?case 1:printf("请输入添加项目的名称:");Р scanf("%s",&charge[i].name);Р printf("请输入添加项目的金额:");Р scanf("%d",&charge[i].much);Р printf("请输入收费金额的单位:");Р scanf("%s",&charge[i].unit);Р printf("请输入收费项目的周期:");Р scanf("%s",&charge[i].cycle);Р printf("成功添加项目!\n");Рfprintf(fp,"%20s%d%20s%16s",charge[i].name,charge[i].much,charge[i].unit,charge[i].cycle);i++;Р fclose(fp);goto repeat;