# 结构体--日期计算

struct  Date{
int year;
int month;
int day;
};

#include <iostream>
using namespace std;

struct Date{
int year;
int month;
int day;
};

int main()
{
Date d;
cin>>d.year>>d.month>>d.day;
//bengin

//end
return 0;
}

2002 3 1

60

#include <stdio.h>
int main()
{
int m,d,s,y;
scanf("%d%d%d",&y,&m,&d);
s=0;
if((y%4==0&&y%100!=0)||(y%400==0))
{
if(m>2) s=s+1;
}
if(m>1) s=s+31;
if(m>2) s=s+28;
if(m>3) s=s+31;
if(m>4) s=s+30;
if(m>5) s=s+31;
if(m>6) s=s+30;
if(m>7) s=s+31;
if(m>8) s=s+31;
if(m>9) s=s+30;
if(m>10) s=s+31;
if(m>11) s=s+30;
s=s+d;
printf("%d\n",s);
return 0;
}

#include <iostream>
using namespace std;

struct Date{
int year;
int month;
int day;
};

int main()
{
Date d;
cin>>d.year>>d.month>>d.day;
//bengin

int sum;
int leap;
if(d.year%400==0||(d.year%4==0&&d.year%100!=0)) //判断是不是闰年
leap=1;  //闰年
else
leap=0; //非闰年

switch(d.month)//先计算某月以前月份的总天数
{
case 1:sum=0;break;
case 2:sum=31;break;
case 3:sum=59;break;
case 4:sum=90;break;
case 5:sum=120;break;
case 6:sum=151;break;
case 7:sum=181;break;
case 8:sum=212;break;
case 9:sum=243;break;
case 10:sum=273;break;
case 11:sum=304;break;
case 12:sum=334;break;
}
sum=sum+d.day; //再加上某天的天数

if(leap==1&&d.month>2)//如果是闰年且月份大于2,总天数应该加一天
sum++;
cout<<sum<<endl;

//end
return 0;
}