Advertisement
vaakata

NumbersInRevOrder_16._05._2016

May 31st, 2016
663
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace NumbersInRevOrder_16._05._2016
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             char[] number = Console.ReadLine().ToArray();
  14.             int l = number.Length;
  15.             ReversingNumber(number, l);
  16.  
  17.         }
  18.  
  19.         static void ReversingNumber(char[] number, int l)
  20.         {
  21.             int i = l - 1;
  22.             char[] revNumber = new char[l];
  23.  
  24.             while (i >= 0)
  25.             {
  26.                 revNumber[l - 1 - i] = number[i];
  27.                 i--;
  28.             }
  29.  
  30.             foreach (char revnumber in revNumber)
  31.             {
  32.                 Console.Write(revnumber);
  33.             }
  34.             Console.WriteLine();
  35.         }
  36.     }
  37. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement