An application of IntSequence objects. | Lecture 8 - slide 25 : 37 Program 1 |
using System; class SeqApp { public static void Main(){ IntSequence isq = new IntCompSeq( new IntCompSeq( new IntInterval(3,5), new IntSingular(17) ), new IntCompSeq( new IntInterval(12,7), new IntSingular(29) ) ); Console.WriteLine("Min: {0} Max: {1}", isq.Min, isq.Max); foreach(int i in isq) Console.Write("{0,4}", i); } } |