#include <stdio.h>int main()?{?? ? /* 定義需要計算的日期 */? ? int year = 2008;? ? int month = 8;? ? int day = 8;? ? ?int date=0;? ? switch(month)? ? {? ? case 1:date+=31;? ? case 2:if(year%4==0){? ? ? ? date+=29;? ? }else{? ? ? ? date+=28;? ? };? ? case 3:date+=31;? ? case 4:date+=30;? ? case 5:date+=31;? ? case 6:date+=30;? ? case 7:date+=31;? ? case 8:date+=31;? ? break;? ? }? ? date=date+day;? ? printf("%d年%d月%d日是該年的第%d天",year,month,day,date); return 0;}
- 3 回答
- 0 關(guān)注
- 1630 瀏覽
添加回答
舉報
0/150
提交
取消