fork download
  1. using System;
  2. using static System.Console;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var horaC1 = new DateTime(2019, 1, 1, 23, 0, 0).TimeOfDay;
  7. var horaC2 = new DateTime(2019, 1, 2, 6, 0, 0).TimeOfDay;
  8. var now = new DateTime(2019, 1, 2, 5, 0, 0).TimeOfDay;
  9. if (now >= horaC1 || now <= horaC2) WriteLine("Turno 3");
  10. now = new DateTime(2019, 1, 2, 7, 0, 0).TimeOfDay;
  11. if (now >= horaC1 || now <= horaC2) WriteLine("Turno 3 ---");
  12. }
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/357680/101
Success #stdin #stdout 0.02s 16032KB
stdin
Standard input is empty
stdout
Turno 3