#include<bits/stdc++.h> using namespace std; int main() { int M,D,y,m,d; cin>>M>>D>>y>>m>>d; if(m+d==M+D){ cout<<y+1<<" "<<1<<" "<<1; } else if(d==D){ cout<<y<<" "<<m+1<<" "<<1; } else { cout<<y<<" "<<m<<" "<<d+1; } return 0; }
#include<bits/stdc++.h> using namespace std; int main() { int M,D,y,m,d; cin>>M>>D>>y>>m>>d; d++; if(d>D) { d=1; m++; } if(m>M) { m=1; y++; } cout<<y<<" "<<m<<" "<<d; return 0; }
#include<bits/stdc++.h> using namespace std; int main() { int M,D,y,m,d; cin>>M>>D>>y>>m>>d; d++; //明天 if(d>D) //超过了当前月的最大天数 { d=1; //天数归1 m++; //月份增加 } if(m>M) //超过了年份的最大月份 { m=1; //月份归1 y++; //年份增加 } cout<<y<<" "<<m<<" "<<d; return 0; }
Using your lizikid universal account