Exemplo n.º 1
0
 private static void Main(string[] args)
 {
     Console.Write("Input a string to reverse [or press ENTER to terminate]: ");
     try
     {
         var inputPhrase = Console.ReadLine();
         while (inputPhrase.Length > 0)
         {
             var reversedString = StringReverser.ReverseWordOrderInThisString(inputPhrase);
             Console.WriteLine("Output String: " + reversedString);
             Console.Write("Input a string to reverse  [or press ENTER to terminate]: ");
             inputPhrase = Console.ReadLine();
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //calling the ReverseString from the StringReverser class
            var reversedString = StringReverser.ReverseString("Pelumi");

            Console.WriteLine(reversedString);

            //calling the ReverseArryOfIntegers from the ArrayReverser class
            var reversedArray = ArrayReverser.ReverseArryOfIntegers(new int[] { 1, 2, 3, 4, 5, 5 });

            Console.WriteLine(reversedArray);

            Console.ReadLine();

            Console.WriteLine(ArrayReverser.ReverseNumber(123));
            Console.ReadLine();

            var stopWatch = new StopWatch();
        }