diff --git a/Digits Sort Dummy/Program.cs b/Digits Sort Dummy/Program.cs index c7b7f78..7486e56 100644 --- a/Digits Sort Dummy/Program.cs +++ b/Digits Sort Dummy/Program.cs @@ -6,8 +6,30 @@ private static void Main(string[] args) int inputValue = ReadInt(); Console.WriteLine("You entered {0}", inputValue); - // TODO: implement your program + List list = new List(); + // checking all char to one the list + foreach (char c in inputValue.ToString()) + { + int digit = int.Parse(c.ToString()); + // check if digit is not 0 or 5 + if (digit != 0 && digit != 5) + { + list.Add(int.Parse(c.ToString())); + } + } + + + // debug output for al chars + //list.ForEach(x => Console.WriteLine(x)); + + // this sorts the list to to numbers + list.Sort(); + + + // now print all the numbers + Console.WriteLine("The sorted Number of '{0}' is:", inputValue); + list.ForEach(x => Console.Write(x)); } static int ReadInt()