fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public struct tstru
  6. {
  7. public int cow { set; get; }
  8. public int pig { set; get; }
  9. public int goat { set; get; }
  10. }
  11.  
  12. public static void Main()
  13. {
  14. tstru farm_a = new tstru();
  15. tstru farm_b = new tstru();
  16.  
  17. farm_a.cow = 4;
  18. farm_a.pig = 79;
  19. farm_a.goat = 382;
  20.  
  21. farm_b.cow = 4;
  22. farm_b.pig = 79;
  23. farm_b.goat = 382;
  24.  
  25. if (farm_a.Equals(farm_b))
  26. Console.WriteLine("The farms are equal");
  27. else
  28. Console.WriteLine("There is a discrepancy between the farms");
  29.  
  30. string fname = string.Format("coyote_{0:yyMMdd}.log", DateTime.Now);
  31. Console.WriteLine("File: '{0}'", fname);
  32.  
  33. Console.WriteLine("Date/Time: {0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
  34. }
  35. }
  36.  
Success #stdin #stdout 0.07s 32360KB
stdin
Standard input is empty
stdout
The farms are equal
File: 'coyote_240415.log'
Date/Time: 2024-04-15 04:28:49