#include <stdio.h>
int main()
{
int year = 2008;
int month = 8;
int day = 8;
int sum,num;
switch(month)
{
case 1;sum=0;break;
case 2;sun=0+28;break;
case 3;sum=0+28+31;break;
case 4;sum=0+28+31+30;break;
case 5;sum=0+28+31+30+31;break;
case 6;sum=0+28+31+30+31+30;break;
case 7;sum=0+28+31+30+31+30+31;break;
case 8;sum=0+28+31+30+31+30+31+31;break;
case 9;sum=0+28+31+30+31+30+31+31+30;break;
case 10;sum=0+28+31+30+31+30+31+31+30+31;break;
case 11;sum=0+28+31+30+31+30+31+31+30+31+30;break;
case 12;sum=0+28+31+30+31+30+31+31+30+31+30+31;break;
default:printf("还有12个以上的月份?");
}
sun=sun+day;
if(year%4=0)
{
num=1;
}
else
{
num=0;
}
if(num==1)
{
sum+1;
printf("2008年8月8日是该年中第%d\n",sum);
}
return 0;
}
onemoo
慕后端9788028
相关分类