-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5093.cpp
More file actions
41 lines (40 loc) · 949 Bytes
/
5093.cpp
File metadata and controls
41 lines (40 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
using namespace std;
int main(){
int year,month,day,th;
cin>>year>>month>>day>>th;
for(int i=1;i<=th;i++){
day++;
if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
if(day==32){
day=1;
month++;
}
}
if(month==4||month==6||month==9||month==11){
if(day==31){
day=1;
month++;
}
}
if(month==2){
if((year%4==0&&year%100!=0)||(year%400==0)){
if(day==30){
day=1;
month++;
}
}
else{
if(day==29){
day=1;
month++;
}
}
}
if(month==13){
month=1;
}
}
cout<<year<<"."<<month<<"."<<day<<endl;
return 0;
}