for(i=0;i<m;i++)
{
if(strcmp(thi[i].name,name)==0){k=1;break;}
}
if(i==m)k=0;
if(k==0)printf("\n不存在该成员的收支信息。\n");
if(k==1)
{
printf("\n以下为%s的所有收支信息:\n\n年份 月份 收入(元) 支出(元)\n",name);
for(i=0;i<m;i++)
{
if(strcmp(thi[i].name,name)==0)
printf("%4d%4d%9d%9d\n",thi[i].year,thi[i].month,thi[i].income,thi[i].output);
}
printf("\n请输入需要删除的收支信息的具体时间:\n年份 月份\n"); scanf("%d%d",&year,&month);
for(i=0;i<m;i++)
if(strcmp(thi[i].name,name)==0&&thi[i].year==year&&thi[i].month==month) {
g=i;h=1;break;
}
if(h==1)
{
m=b-1;
fp=fopen("thinglist4.txt","w");
fprintf(fp,"%d\n",m);
for(i=0;i<g;i++)
fprintf(fp,"%s %d %d %d %d\n",thi[i].name,thi[i].year,thi[i].month,thi[i].income,thi[i].output);
for(i=g+1;i<b;i++)
fprintf(fp,"%s %d %d %d %d\n",thi[i].name,thi[i].year,thi[i].month,thi[i].income,thi[i].output);
fclose(fp);
printf("\n······\n删除成功。\n");
}
if(h==0)
printf("\n不存在该时间的收支信息。。。\n");
}
return 0;
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库C语言课程设计——家庭财务管理系统(6)在线全文阅读。
相关推荐: