Advertisement
Stann

We All Love Bits!

Mar 7th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace WeAllLoveBits
  8. {
  9.     class WeAllLoveBits
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             for (int i = 0; i < n; i++)
  15.             {
  16.                 int input = int.Parse(Console.ReadLine());
  17.                 string inputString = Convert.ToString(input, 2);
  18.                 char[] arr = inputString.ToCharArray();
  19.                 Array.Reverse(arr);
  20.                 Console.WriteLine(Convert.ToInt32(new string(arr), 2));
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement