#include<stdio.h>
bool Leapyear(int n)
{
if((n%4==0&&n%100!=0)||n%400==0)
return true;
else
return false;
}
int Days(int a,int b,int c)
{
int two=28;
if(Leapyear(a))
two=29;
int sum =0;
switch(b){
case 1:
sum=c;break;
case 2:
sum=31+c;break;
case 3:
sum = 31+two+c;break;
case 4:
sum = 31+two+31+c;break;
case 5:
sum = 31+two+31+30+c;break;
case 6:
sum = 31+two+31+30+31+c;break;
case 7:
sum = 31+two+31+30+31+30+c;break;
case 8:
sum = 31+two+31+30+31+30+31+c;break;
case 9:
sum = 31+two+31+30+31+30+31+31+c;break;
case 10:
sum = 31+two+31+30+31+30+31+31+30+c;break;
case 11:
sum = 31+two+31+30+31+30+31+31+30+31+c;break;
case 12:
sum = 31+two+31+30+31+30+31+31+30+31+30+c;break;
}
return sum;
}
int main()
{
int y,m,d;
scanf("%d-%d-%d",&a,&b,&c);
printf("%d\n",Days(a,b,c));
return 0;
}
|