输入年月日判断输入的日期是当前的第几天
#include<stdio.h>
int main(void)
{
int year,month,day;
int i,j;
int num=0;
int a[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int b[12]={31,29,31,30,31,30,31,31,30,31,30,31};
bool x;
printf("请输入年月日\n");
scanf("%d %d %d",&year,&month,&day);
if((year%4==0)&&(year%100!=0) || (year%4==0)&&(year%400)==0)
x=true;
else
x=false;
if(x)
{
for(i=0;i<month;i++)
num+=b[i];
num+=day;
}
else
{
for(j=0;j<month;j++)
num+=a[j];
num+=day;
}
printf("今天是%d年的第%d天\n",year,num);
return 0;
}