fork(1) download
  1. using System;
  2. using Microsoft.VisualBasic;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. DateTime dateBegin = new DateTime(2016,02,27);
  8. DateTime dateEnd =new DateTime(2017,02,27);
  9. TimeSpan sp = dateEnd - dateBegin;
  10. Console.WriteLine(sp.Days);
  11. if (DateTime.IsLeapYear(dateEnd.Year))
  12. {
  13. if (sp.Days > 366)
  14. {
  15. Console.WriteLine("Ошибка 365");
  16. }
  17. }
  18. else
  19. {
  20. if (sp.Days > 365)
  21. {
  22. Console.WriteLine( "Ошибка 365");
  23. }
  24. }
  25. }
  26. }
Success #stdin #stdout 0s 29672KB
stdin
Standard input is empty
stdout
366
Ошибка 365