#include <stdio.h>
int main()
{
{
int x,y,z;
int n=0;
scanf("%d-%d-%d", &x,&y,&z);
if (x%400==0||(x%4==0&&x%100!=0))
{
n=1;
}
else
{
n=2;
}
int m=0;
switch(n)
{
case 1:
m=29;
case 2:
m=28;
}
int i[]={31, m, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int sum=0;
int j=0;
for (j=0;j<y-1;j++)
{
sum+=i[j];
}
sum=sum+z;
printf("%d",sum);
/*********end*********/
return 0;
}
}
输入: 2012-3-1
应显示:61
实显示:60
往后也是,都少一天