急!!!!!高手帮助
这个程序应该怎么改#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
void TodayNeedToDo();
void RememberDayManage();
void Wordpad();
void Monthlycalendar();
int inputnum;
printf("*********<<<<<Calendar>>>>***********\n");
printf("Please select one of the following program:\n");
printf("1: <TodayNeedToDo>\n");
printf("2: <RememberDay Manage>\n");
printf("3: <Wordpad>\n");
printf("4: <Monthly calendar>\n");
printf("5: <exit this program>\n");
printf("****************************************************\n");
printf("-----------------------------------------------------n");
printf("You can select 1-5\n");
scanf("%d",&inputnum);
/*not exit program untill input 4*/
while(inputnum!=5)
{
switch(inputnum)
{
case 1: TodayNeedToDo();break;
case 2: RememberDayManage();break;
case 3: Wordpad();break;
case 4: Monthlycalendar;break;
}
printf("\n");
printf("*********<<<<<Calendar>>>>***********\n");
printf("Please select one of the following program:\n");
printf("1: <TodayNeedToDo>\n");
printf("2: <RememberDay Manage>\n");
printf("3: <Wordpad>\n");
printf("4: <Monthly calendar>\n");
printf("5: <exit this program>\n");
printf("****************************************************\n");
printf("-----------------------------------------------------n");
printf("You can select 1-5\n");
scanf("%d",&inputnum);
}
}
void TodayNeedToDo()
{
}
void RememberDayManage()
{
}
void Wordpad()
{
}
void Monthlycalendar()
{
int main()
{
int yr,mth,mtd,wkd,mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
printf("Input the Year and Month(Year-Month):");
scanf("%d-%d",&yr,&mth);
if (yr<0||mth<1||mth>12)
return 0;
if (JgYr(yr))
mthd[2]=29;
mtd=mthd[mth];
wkd=CalWkd(yr,mth);
showcld(wkd,mtd);
return 0;
}
int JgYr(int yr)
{
if (yr%4==0&&yr%100!=0||yr%100==0&&yr%400==0)
return 1;
else
return 0;
}
int CalWkd(int yr,int mth)
{
int ds=0,i,rst,wkd;
int mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if (JgYr(yr))
mthd[2]=29;
for (i=1;i<mth;i++)
ds+=mthd[i];
ds+=1;
rst=yr-1+(int)((yr-1)/4)-(int)((yr-1)/100)+(int)((yr-1)/400)+ds;
wkd=rst%7;
return wkd;
}
showcld(int wkd,int mtd)
{
int dt=1,i,j=0;
printf("Sun\tMon\tTue\tWed\tThu\tFri\tSat\n");
for (i=0;i<wkd;i++)
{
printf("\t");
j++;
}
while (j!=7)
{
printf("%d",dt);
if (j<6)
printf("\t");
else
printf("\n");
dt++;
j++;
}
while (1)
{
for (j=0;j<7;j++)
{
printf("%d",dt);
if (j!=6)
printf("\t");
else
printf("\n");
if (dt!=mtd)
dt++;
else
return 0;
}
}
}
}