fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5.  
  6. public static TOut Map<Tin, TOut>(Tin element)
  7. {
  8. return (TOut)Convert.ChangeType(element, typeof(TOut));
  9. }
  10.  
  11. public static void Main()
  12. {
  13. var n = Map<string,int>("123");
  14. var s = Map<int,string>(321);
  15. Console.WriteLine("{0} {1}", n, s);
  16. }
  17. }
Success #stdin #stdout 0.05s 34056KB
stdin
Standard input is empty
stdout
123 321