简简单单的就好
#include <stdio.h>
int main()
{
/*请使用switch语句和if...else语句,计算2008年8月8日这一天,是该年中 的第几天*/
int year = 2008;
int month = 8;
int day = 8;
int result = 0;
int flat = month - 1;
do{
switch(flat) {
case 12: result+=31; break;
case 11: result+=30; break;
case 10: result+=31; break;
case 9: result+=30; break;
case 8: result+=31; break;
case 7: result+=31; break;
case 6: result+=30; break;
case 5: result+=31; break;
case 4: result+=30; break;
case 3: result+=31; break;
case 2:
if(year%4!=0) result+=28;//平年
else result+=29;//闰年
break;
case 1: result+=31; break; }
}while(flat--);
printf("%d年%d月%d日是该年的第%d天",year,month,day,result+day);
return 0;
}