#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
int get_day[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int add(int y){
if((y%4==0&&y%100!=0)||y%400==0)return 29;
else return 28;
}
int get_len(int x){
int s=0;
while(x!=0){
x=x/10;
s++;
}
return s;
}
string get_str(int x){
string s;
while(x!=0){
s+=x%10-'0';
x=x/10;
}
reverse(s.begin(),s.end());
return s;
}
string get_string(int y,int m,int d){
string s;
if(get_len(y)<4){
for(int i=1;i<=4-get_len(y);i++)s+="0";
}
s+=get_str(y);
if(get_len(m)<2){
for(int i=1;i<=2-get_len(y);i++)s+="0";
}
s+=get_str(m);
if(get_len(d)<2){
for(int i=1;i<=2-get_len(d);i++)s+="0";
}
s+=get_str(d);
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
bool f1=0,f2=0;
int y=0,m=0,d=0;
string s;
cin>>s;
for(int i=0;i<4;i++)y=y*10+s[i]-'0';
for(int i=4;i<6;i++)m=m*10+s[i]-'0';
for(int i=6;i<8;i++)d=d*10+s[i]-'0';
while(f1==0||f2==0){
d++;
if(d>get_day[m])d=1,m++;
if(m>12)y++,get_day[2]=add(y);
string s=get_string(y,m,d);
reverse(s.begin(),s.end());
string ss=s;
reverse(s.begin(),s.end());
if(s==ss){
if(!f1)cout<<s<<endl,f1=1;
if(s[0]==s[2]&&!f2)cout<<s<<endl,f2=1;
}
}
return 0;
}
这个代码我在dev-c++中运行输入之后会显示
Process exited after 6.312 seconds with return value 3221226356,这是怎么回事?