文章
9
粉丝
101
获赞
0
访问
5.4k
#include<bits/stdc++.h>
using namespace std;
int main(){
int year1=0,month1=0,day1=0;
int year2=0,month2=0,day2=0;
scanf("%4d%2d%2d",&year1,&month1,&day1);
scanf("%4d%2d%2d",&year2,&month2,&day2);
int daynum[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int ans=0;
//先判断year1是否是闰年
if((year1%4==0&&year1%4!=100)||year1%400==0){
daynum[2]=29;
}el...
登录后发布评论
闰年判断逻辑有问题
if((year1%4==0&&year1%100!=0)||year1%400==0)