真的不懂這語句的意思
#include <stdio.h>
int main()?
{?
? ? /* 定義需要計算的日期 */
? ? int year = 2008;
? ? int month = 8;
? ? int day = 8;
? ? int date=0;
? ? switch(month)
? ? {
? ? ? ? case 12:date +=30;
? ? ? ? case 11:date +=31;
? ? ? ? case 10:date +=30;
? ? ? ? case 9:date +=31;
? ? ? ? case 8:date +=31;
? ? ? ? case 7:date +=30;
? ? ? ? case 6:date +=31;
? ? ? ? case 5:date +=30;
? ? ? ? case 4:date +=31;
? ? ? ? case 3:
? ? ? ? ? if(year%400==0||(year%4==0&&year%100!=0)){
? ? ? ? ? date +=29;
? ? ? ? ? }
? ? ? ? ? else{
? ? ? ? ? date +=28;
? ? ? ? ? }
? ? ? ? case 2:date +=31;
? ? ? ? default :date +=8,printf("2008年8月8日是該年中的第%d天",date);break;
? ? }
return 0;
}
2016-09-19
程序是是可以運行的,但表達(dá)的意思是不符合題意的,結(jié)果應(yīng)該是31。。有問題