fork(2) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Console.WriteLine(Max(1, 1));
  8. Console.WriteLine(Max(1, 2));
  9. Console.WriteLine(Max(2, 1));
  10. Console.WriteLine(Max(1, null));
  11. Console.WriteLine(Max(null, 1));
  12. Console.WriteLine(Max(null, null));
  13. }
  14.  
  15. public static int? Max (int? a, int? b)
  16. {
  17. return a > b ? a : b ?? a;
  18. }
  19. }
Success #stdin #stdout 0.03s 24104KB
stdin
Standard input is empty
stdout
1
2
2
1
1