#include<stdio.h>
int main()
{
int y[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int year,month,day,z=0,i,n;
printf("请输入年-月-日:");
scanf("%d-%d-%d\n",year,month,day);
for(i=0;i<14;i++)
{
z=z+y[i] ;
if(1+i==month)
break;
}
n=z+day;
if(year%400==0||year%4==0&&year%100!=0)
printf("%d",n+1);
else
printf("%d",n);
return 0;
}
onemoo
相关分类