用c语言编一个程序
运行的时候输入你想要的年份
就能出现当年的日历
日历显示最好是一行4个月一共3行
也就是说一个屏就能全部显示的下
最后要写出整个程序的思路
或者用流程图 或者用自己的语言
万年历
#include
int IsLeapYear(int);
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_da...全部
万年历
#include
int IsLeapYear(int);
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;
}
希望对你有帮助。
收起