邹子涵 • 1个月前
评论:
#include<iostream> // cin\cout\endl
#include<cstdio> //scanf()\printf()
#include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset()
#include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min()
using namespace std;
int main(){
int y,m,d,h,k,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
cin>>y>>m>>d>>h>>k;
if(y%4==0&&y%100!=0||y%400==0)
{
a[2]++;
}
h+=k;
if(h>=24){
h-=24;
d++;
if(d>a[m]){
d=1;
m++;
if(m>12){
m=1;
y++;
}
}
}
cout<<y<<endl;
cout<<m<<endl;
cout<<d<<endl;
cout<<h<<endl;
return 0;
}