fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. var list = new List<Tuple<int, string>>();
  9.  
  10. list.Add(Tuple.Create(31, "Jan"));
  11. list.Add(Tuple.Create(28, "Feb"));
  12. list.Add(Tuple.Create(31, "Mar"));
  13. list.Add(Tuple.Create(30, "Apr"));
  14. list.Add(Tuple.Create(31, "Jan"));
  15.  
  16. list.Sort((Tuple<int, string> t1, Tuple<int, string> t2) => (t2.Item1 - t1.Item1));
  17.  
  18. foreach (var t in list)
  19. {
  20. Console.WriteLine("{0} {1}", t.Item1, t.Item2);
  21.  
  22. }
  23. }
  24. }
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(8,29): error CS0246: The type or namespace name `Tuple' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(8,9): error CS0825: The contextual keyword `var' may only appear within a local variable declaration
prog.cs(10,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(11,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(12,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(13,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(14,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(16,9): error CS0841: A local variable `list' cannot be used before it is declared
prog.cs(18,27): error CS0841: A local variable `list' cannot be used before it is declared
Compilation failed: 9 error(s), 0 warnings
stdout
Standard output is empty