#include<stdio.h>
int main()
{
int year;
int month;
int day;
int sum=0;
scanf("%d/%d/%d",&year,&month,&day);
sum=sum+day;
int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int i;
for(i=1;i<month;i++){
sum=sum+a[i];
}
int is=0;
if((year%100!=0&&year%4==0)||(year%400==0)){
is=1;
}
if(is==1&&month>2){
sum+=1;
}
printf("%d",sum);
return 0;
}
7-19 计算天数
最新推荐文章于 2024-11-11 08:43:45 发布