急!请高手帮我一下
帮我我看看下面这个程序,我调试不出来。只好求高手与大侠了#include <stdio.h>
#define Sunday 0
#define Monday 1
#define Tuesday 2
#define Wednesday 3
#define Thursday 4
#define Friday 5
#define Saturday 6
void GiveInstructions(void);
int GetYearFromUser(void);
void PrintCalendar(int year);
void PrintCalendarMonth(int month,int year);
void IndentFirstLine(int weekday);
int MonthDays(int month,int year);
int FirstDayofMonth(int month,int year);
string MonthName(int month);
bool IsLeapYear(int year);
void main()
{
int year;
GiveInstructions();
GetYearFromUser();
PrintCalendar();
}
void GiveInstructions(void){
printf("This program dispalys a calendar for a full.\n");
printf("year.This year must be not before 1990");
}
int GetYearFromUser(void){
int year;
while(TURE){
printf("Please enter the year:");
scanf("%d",&year);
if(year>1990)
return(year);
printf("The year must be at least 1990");
}
}
void PrintCalendar(int year){
int month;
for(month=1;month<=12;month++){
PrintCalendarMonth(month,year);
}
printf("\n");
}
void PrintCalendarMonth(int month,int year){
int weekday,nDays,day;
printf(" %s %d\n",MonthName(month),year);
printf(" Su Mo Tu We Th Fr Sa\n");
nDays=MonthDays(int month,int year);
weekday=FirstDayofMonth(int month,int year);
IndentFirstLine(weekday);
for(day=1;day<=nDay;day++){
printf(" %2d",day);
if(weekday==Saturday)
printf("\n");
weekday=(weekday+1)%7;
}
if(weekday!=Sanday)
printf("\n");
}
void IndentFirstLine(int weekday){
int i;
for(i=0;i<weekday;i++)
printf(" ");
}
int MonthDays(int month,int year){
switch(month){
case 2;
if(IsLeapYear(year))
return(29);
return(28);
case 1:case 3:case 5:case 7:case 8:case 10:case 12:
return(31);
default return(30);
}
}
int FirstDayofMonth(int month,int year){
weekday=Monday;
for(i=1990;i<year;i++){
weekday=(weekday+365)%7;
if(IsLeapYear)
weekday=(weekday+1)%7;
}
for(i=1;i<month;i++){
weekday=(weekday+MonthDays(month,year))%7;
}
return(weekday);
}
bool IsLeapYear(int year){
return((year%4==0)&&(year%100!=0)||(year%400==0));
}
string MonthName(int month){
switch(manth){
case 1: return ("January");
case 2: return ("Febrruary");
case 3: return ("March");
case 4: return ("April");
case 5: return ("May");
case 6: return ("june");
case 7: return ("july");
case 8: return ("August");
case 9: return ("September");
case 10: return ("October");
case 11: return ("Noveber");
case 12: return ("december");
}
}