话说这么写是简单还是更麻烦了
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 1;
int day = 8;
int i = 0 ;
for(int r = 0 ; r< month ; r++){
if(r==1||r==3||r==5||r==7||r==8||r==10||r==12){
i+=31;
}else if(r==4||r==6||r==9||r==11){
i+=30;
}
}
if(month>=2){
if((year%4==0&&year%100!=0)||(year%400==0)){
i+=29;
}else{
i+=28;
}
}
i+=day;
printf("%d年%d月%d日是该年的第%d天\n",year,month,day,i);
return 0;
}