*不正经题解*
2026-09-21 22:16:10
发布于:湖北
1阅读
0回复
0点赞
不正经题解
#include<bits/stdc++.h>
using namespace std;
struct YEAR{
public:
bool operator== (const YEAR o)const{
if(a==o.a&&b==o.b&&c==o.c) return true;
return false;
}
bool operator!= (const YEAR o)const{
if(a==o.a&&b==o.b&&c==o.c) return false;
return true;
}
YEAR& operator++(){
c++;
if((b==1&&c==32)||(b==3&&c==32)||(b==4&&c==31)||(b==5&&c==32)||(b==6&&c==31)||(b==7&&c==32)||(b==8&&c==32)||(b==9&&c==31)||(b==10&&c==32)||(b==11&&c==31)||(b==12&&c==32)||(((a%4==0&&a%100!=0||a%400==0)&&b==2&&c==30)||(!(a%4==0&&a%100!=0||a%400==0)&&b==2&&c==29))){
b++;
c=1;
}
if(b>12){
a++;
b=1;
}
return *this;
}
private:
int a,b,c;
public:
void Get(){
cin>>a>>b>>c;
}
}A,B;
int main(){
A.Get();
B.Get();
long long c=1;
while(A!=B){
++A;
c++;
}
cout<<c;
}
这里空空如也







有帮助,赞一个