Код C#1
2
3
4
5
6
7
8
9
10
11
12
13
try
{
Console.WriteLine("Enter year ");
int year = int.Parse(Console.ReadLine());
Console.WriteLine("Enter month ");
byte month = byte.Parse(Console.ReadLine());
DateTime d = new DateTime(year, month, 1);
DateTime a = new DateTime(year, month+1, 1);
Console.WriteLine("Days of month: "+(a - d).ToString().Substring(0,2));
}
catch (Exception ex)
{ Console.WriteLine(ex.ToString() + "\n" + ex.Message); } вот так?