ΪʲôһֱÅж϶¼ÊÇÈòÄê°¡
±¾Ìû×îºóÓÉ Âå³ÇÎÅµÑ ÓÚ 2018-8-13 22:29 ±à¼#include <stdio.h>
int main()
{
int r= {31,29,31,30,31,30,31,31,30,31,30,31};
int nr= {31,28,31,30,31,30,31,31,30,31,30,31};
int year,i;
printf("ÇëÊäÈëÒ»¸öÄê·Ý£º");
scanf("%d",year);
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
{
for (i=0; i<12; i++)
{
printf("%2dÔÂ·Ý £»%dÌì\n",i+1,r);
}
}
else
{
for (i=0; i<12; i++)
{
printf("%2dÔÂ·Ý £»%dÌì\n",i+1,nr);
}
}
return 0;
}
scanf ÄÄÀïÉÙÁË &
Ò³:
[1]