You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
327 B
C++

#include <cstdio>
using namespace std;
int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
for(int i=1;i<=12;i++)a[i]+=a[i-1];
int y,m,d;
while(~scanf("%d/%d/%d",&y,&m,&d))
{
int f=m<=2?0:((y%100==0)?(y%400==0):(y%4==0));
printf("%d\n",a[m-1]+d+f);
}
return 0;
}