5. Дата след 5 дни
Моля за помощ
Това ми е решението, а Judge не го приема. Получавам грешка:
Unhandled Exception: System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at _05.Date_after_5_Days.Program.Main(String[] args)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _05.Date_after_5_Days
{
class Program
{
static void Main(string[] args)
{
int date = int.Parse(Console.ReadLine());
int month = int.Parse(Console.ReadLine());
string dateMonth = "" + date + "."+month;
var newDate = DateTime.Parse(dateMonth);
newDate = newDate.AddDays(5);
Console.WriteLine($"{newDate:d.MM}");
// Console.WriteLine(newDate.ToString("d/MM"));
}
}
}
Благодаря!
Получи се