#include<stdio.h>
void date1(int year,int month,int day,int days);
void date2(int year,int month,int day,int days);
int main(void)
{
int Year,Month,Day,Days;
printf("Enter three numbers:");
scanf("%d %d %d %d",&Year,&Month,&Day,&Days);
if((Year%4==0 && Year%100!=0) || (Year%400==0))
date1(Year,Month,Day,Days);
else
date2(Year,Month,Day,Days);
return 0;
}
void date1(int year,int month,int day,int days)
{
int i,j;
j=days;
i=month;
int MONTH[12]={31,29,31,30,31,30,31,31,30,31,30,31};
if(days<=(MONTH[month-1]-day))
printf("%d days after %d,%d,%d is %d,%d,%d",j,year,month,day,year,month,days+day);
else
{
days=days-(MONTH[month-1]-day);
while(days>MONTH[i])
{
days=days-MONTH[i];
i++;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载