Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Date_After_Five_Days
- {
- class Program
- {
- static void Main(string[] args)
- {
- int day = int.Parse(Console.ReadLine());
- int month = int.Parse(Console.ReadLine());
- day += 5;
- if (month == 2)
- {
- if (day > 28)
- {
- day = day - 28;
- month++;
- }
- }
- else if (month == 4 || month == 6 || month == 9 || month == 11)
- {
- if (day > 30)
- {
- day = day - 30;
- month++;
- }
- }
- else
- {
- if (day > 31)
- {
- day = day - 31;
- month++;
- }
- }
- if (month > 12)
- {
- month = month - 12;
- }
- Console.WriteLine("{0}.{1}", day, month.ToString().PadLeft(2, '0'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement