C语言高手请进下面是一个日历表,
改很麻烦。
不如用以下这个程序吧。
#include
#include
#include
int IsLeapYear(int);
void main()
{
int i;
int day;
int year;
int temp;
int temp_i;
long int Year_days = 0;
int Year_Start = 1;
int Per_Year_Days;
int month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please enter the year: ");
scanf("%d",&...全部
改很麻烦。
不如用以下这个程序吧。
#include
#include
#include
int IsLeapYear(int);
void main()
{
int i;
int day;
int year;
int temp;
int temp_i;
long int Year_days = 0;
int Year_Start = 1;
int Per_Year_Days;
int month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please enter the year: ");
scanf("%d",&year);
while(Year_Start 1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >= 10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
else
while (day 1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >=10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
printf("\n");
if( getch() == 'q' )
exit(0);
}
getch();
}
int IsLeapYear( int year )
{
if ((year %4 == 0) && (year % 100 != 0) ||
(year % 400 == 0) )
return 1;
else
return 0;
}
。收起