#include <stdio.h>
#include<string.h>
int main() {
int year,day,month,sum=0;
int mon[13]={0};
mon[1]=31;mon[3]=31;mon[4]=30;mon[5]=31;mon[6]=30;
mon[7]=31;mon[8]=31;mon[9]=30;mon[10]=31;mon[11]=30;mon[12]=31;
while(scanf("%d %d %d",&year,&month,&day) != EOF){
if((year%4 == 0 && year%100 !=0) || (year % 400 ==0)){
mon[2]=29;
}
else{
mon[2]=28;
}
for(int i=0;i<month;i++){
sum=sum+mon[i];
}
sum=sum+day;
printf("%d\n",sum);
sum=0;
}
return 0;
}
KY19 今年的第几天?
于 2024-03-13 16:00:37 首次发布