#include<stdio.h>
struct data {
int year, month, day;
};
int main() {
struct data today;
scanf("%d.%d.%d", &today.year, &today.month, &today.day);
int flag = (today.year % 4 == 0 && today.year % 100 != 0) || today.year % 400 == 0;
today.day++;
switch (today.month) {
case 1:case 3:case 5:case 7:case 8:case 10:
case 12: {
if (today.day == 32) {
today.month++;
today.day = 1;
}
break;
}
case 4:case 6:case 9:case 11: {
if (today.day == 31) {
today.month++;
today.day = 1;
}
break;
}
case 2: {
if (flag == 1 && today.day == 30) {
today.month++;
today.day = 1;
}
if (flag == 0 && today.day == 29) {
today.month++;
today.day = 1;
}
}
}
if(today.month == 13){
today.year++;
today.month=1;
}
printf("%04d.%02d.%02d",today.year,today.month,today.day);
return 0;
}
|