标签:
#include<stdio.h>
int Runnian(int year)
{
if((year%4==0&&year%100!=0)||year%400==0)
return 1;
return 0;
}
int main()
{
int total,y,m,d,n,i;
while(~scanf("%d/%d/%d",&y,&m,&d))
{
n=Runnian(y);
total=0;
if(m!=1)
{ for(i=1;i<=m-1;i++)
{
if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
total+=31;
if(i==4||i==6||i==9||i==11)
total+=30;
if(i==2)
{
if(n==1) total+=29;
else total+=28;
}
}
}
total+=d;
printf("%d\n",total);
}
return 0;
}
标签:
原文地址:http://www.cnblogs.com/digulove/p/4681515.html