1、#include #include#include#includestruct dataint year,month,day;d1,d2;int judge(int a,int b,int c)int p12=31,28,31,30,31,30,31,31,30,31,30,31;int y12=31,29,31,30,31,30,31,31,30,31,30,31;if(b12)printf(“月数有错,请重新输入!n“);return 0;if(a%4=0)return 0;elseif(cpb-1)printf(“日数有错,请重新输入!n“);return 0;return 1;int
2、count(int a,int b,int c)int p12=31,28,31,30,31,30,31,31,30,31,30,31;int y12=31,29,31,30,31,30,31,31,30,31,30,31;int sum=0;if(a%4=0)id2.year?d1:d2;b=d1.yeard2.year?d2:d1;if(a.year=b.year)/当年份一样应该判断月份 if(d1.monthd2.month)a=d1;b=d2;else b=d1;a=d2;if(a.year=b.yearb=d2;else a=d2;b=d1;for(p=b.year;pa.year;p+)if(p%4=0)elsesum+=365;m=count(a.year,a.month,a.day);n=count(b.year,b.month,b.day);if(b.year%4=0)elsesum=sum+m-n;printf(“%dn“,sum);printf(“是否继续计算?(y/n): “);getchar();/(接收无用的回车字符)ch=getchar();/ ch=getch();