Advertisement
jokerbg

We All Love Bits!

Feb 27th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2. class WeAllLoveBits
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         for (int i = 0; i < n; i++)
  8.         {
  9.             int input = int.Parse(Console.ReadLine());
  10.             string inputString = Convert.ToString(input, 2);
  11.             char[] arr = inputString.ToCharArray();
  12.             Array.Reverse(arr);
  13.             Console.WriteLine(Convert.ToInt32(new string(arr), 2));
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement