有个C语言大程序,谁能帮我看一下
#include<stdio.h>int t;
struct thin
{
char thing[50];
int theimp;
int thetim;
char deadline[10];
int done;
}th[10],ch[10],bh[10],dh[10],sh[10];
int main()
{
void print();
void choose();
print();
choose();
return 0;
}
void print()
{
printf("\n\n ******** 欢迎来到GTD ********\n");
printf(" 1. 收集要做的事\n");
printf(" 2. 完成进程\n");
printf(" 3. 组织事项\n");
printf(" 4. 回顾\n");
printf(" 5. 详细列表\n");
printf(" 0. 退出\n");
printf(" ************谢谢光临**********\n\n\n");
}
void choose()
{
void collection();
void process();
void organize();
void review();
void list();
void exit();
int a;
printf("请输入你想做的事前面的序号:\n");
scanf("%d",&a);
if(a<0||a>5)
{ printf("您输入的数字有误,请重新输入:");
scanf("%d",&a); }
if(a==1) collection();
else if(a==2)process();
else if(a==3)organize();
else if(a==4)review();
else if(a==5)list();
else exit();
}
void collection()
{
void print();
void choose();
FILE *fp;
int a,b,c,d,i=0;
printf("1.添加一个新事项\n");
printf("0.返回\n");
printf("请输入你想做的事的序号:\n");
scanf("%d",&a);
if(a==1)
{ printf("请输入您想要添加的新事项的个数:\n");
scanf("%d",&b);t=b;
while(i<b)
{
printf("请输入您想要添加的第%d个新事项:\n",i+1);
scanf("%s",&th[i].thing);i++;
}
printf("如果输入完毕请选择0,返回\n");scanf("%d",&c);
if(c==0)
{ if((fp=fopen("thing.dat","w"))==NULL){printf("文件不能打开\n"); return; }
for(i=0;i<b;i++)
fprintf(fp,"%s ",th[i].thing);fclose(fp);
print();
choose(); }
else i++;
}
else if(a==0)
{ print();
choose(); }
else printf("输入有误,请重新输入:");scanf("%d",&d);
if(d==0) { print();
choose(); }
}
void process()
{
void print();
void choose();
FILE *fp;
int a,i;
if((fp=fopen("thing.dat","r"))==NULL){printf("文件不能打开\n");return;}
for(i=0;i<t;i++)
fscanf(fp,"%s",&ch[i].thing);
fclose(fp);
for(i=0;i<t;i++)
{
printf("%s\n",ch[i].thing);
printf("1.需要去做. 2.可做可不做. 3.浪费时间\n");
printf("请选择\n");
scanf("%d",&th[i].theimp); }
printf("按0返回主菜单\n");
scanf("%d",&a);
if(a==0)
{ if((fp=fopen("theimp.dat","w"))==NULL) {printf("文件不能打开\n");return;}
for(i=0;i<t;i++)
fprintf(fp,"%d",th[i].theimp);
fclose(fp);
print();
choose();}
else printf("输入有误\n");
}
void organize()
{
void print();
void choose();
FILE *fp,*fp1,*fp2;
int i,a;
if((fp=fopen("thing.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%s",&bh[i].thing);fclose(fp);
if((fp1=fopen("theimp.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%d",&bh[i].theimp);fclose(fp1);
for(i=0;i<t;i++)
if(bh[i].theimp==1)
{ printf("%s",bh[i].thing);
printf("1.今天做. 2. 过几天.\n");
printf("请选择你要做这件事的时间:");
scanf("%d",&th[i].thetim);
if(th[i].thetim=2)
{printf("请输入截止日期:");scanf("%s",&th[i].deadline);} }
printf("按0返回主菜单\n");scanf("%d",&a);
if(a==0)
{ if((fp2=fopen("thetim.dat","w"))==NULL){printf("文件不能打开\n");return;}
for(i=0;i<t;i++)
fprintf(fp,"%d%s",th[i].thetim,th[i].deadline);
fclose(fp2);
print();choose();
}
else printf("输入有误\n");
}
void review()
{
void print();
void choose();
FILE *fp,*fp1,*fp2;
int i,a;
if((fp=fopen("thing.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%s",&dh[i].thing);fclose(fp);
if((fp1=fopen("thetim.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%d",&dh[i].thetim);fclose(fp1);
for(i=0;i<t;i++)
if(dh[i].thetim==1)
{
printf("%s\n",dh[i].thing);
printf("做了没有?1是 或者 2没有\n");
scanf("%d",&th[i].done);
}
printf("按0返回主菜单\n");
scanf("%d",&a);
if(a==0)
{
if((fp2=fopen("done.dat","w"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)
fprintf(fp,"%d",th[i].done);
fclose(fp2);
print();choose();
}
else printf("输入有误\n");
}
void list()
{
void print();
void choose();
FILE *fp,*fp1,*fp2,*fp3;
int i,a;
if((fp=fopen("thing.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%s",&sh[i].thing);fclose(fp);
if((fp1=fopen("theimp.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%d",&sh[i].theimp);fclose(fp1);
if((fp2=fopen("thetim.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%d%s",&sh[i].thetim,&sh[i].deadline);fclose(fp2);
if((fp3=fopen("done.dat","r"))==NULL)
{printf("文件不能打开\n");return;}
for(i=0;i<t;i++)fscanf(fp,"%d",&sh[i].done);fclose(fp3);
printf("今天应该做的事是:\n");
for(i=0;i<t;i++)
if((sh[i].thetim==1)&&(sh[i].done==2))
printf("%s\n",sh[i].thing);
printf("近期应该做的事是:\n");
for(i=0;i<t;i++)
if(((sh[i].thetim==2)&&(sh[i].done==2))||(sh[i].theimp==2))
printf("%s\n",sh[i].thing);
printf("已经做过的事是:\n");
for(i=0;i<t;i++)
if((sh[i].thetim==2)&&(sh[i].done==1))printf("%s",sh[i].thing);
printf("按0返回主菜单\n");scanf("%d",&a);
if(a==0) {print();choose();}
else printf("输入有误\n");
}
void exit()
{
printf("直接关闭即可\n");
}
谢谢大家了,我的fen全在这里了,麻烦大家了,检测是无错误的,但是运行的时候有两个void函数不听使唤,怎么回事。谁能帮忙改一下。