using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication18 { class Program { static void Vymen(ref T a, ref T b) { T pom = a; a = b; b = pom; } static T Minimum(T a, T b) where T: IComparable { if (a.CompareTo(b)<0) return a; else return b; } static void Main(string[] args) { int a = 5; int b = 23; Console.WriteLine("a = {0} b = {1}", a,b); Vymen(ref a, ref b); Console.WriteLine("a = {0} b = {1}", a, b); string sa = "pet"; string sb = "dvacet tri"; Console.WriteLine("sa = {0} sb = {1}",sa,sb); Vymen(ref sa, ref sb); Console.WriteLine("sa = {0} sb = {1}", sa, sb); double da = 5.00; double db = 23.00; Console.WriteLine("da = {0} db = {1}", da, db); Vymen(ref da, ref db); Console.WriteLine(Minimum(11,22)); Console.WriteLine(Minimum("abcd","xyz")); List seznam = new List(); seznam.Add(20); seznam.Add(15); seznam.Add(18); foreach (int i in seznam) { Console.Write("{0} ",i); } /* using (System.IO.StreamReader sr = new System.IO.StreamReader(@"c:\HaxLogs.txt")) { string s = sr.ReadToEnd(); Console.WriteLine(s); } */ } } }