标签:ar io for on amp br ca return print
#include<stdio.h>
int main()
{
int year,month,day;
scanf("%d%d%d",&year,&month,&day);
int runian(int month,int day);
int frunian(int month,int day);
if((year%4==0)&&(year%100!=0)) printf("%d\n",runian(month,day));
else if((year%100==0)&&(year%400==0)) printf("%d\n",runian(month,day));
else
printf("%d\n",runian(month,day)+1);
return 0;
}
int runian(int month,int day)
{
int a[12]={31,28,31,30,31,30,31,30,30,31,30,31};
for(int i=0,sum=0;i<(month-1);i++)
{sum+=a[i];}
return sum+day;
}
标签:ar io for on amp br ca return print
原文地址:http://www.cnblogs.com/guangluwutu/p/4166885.html