Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class WeAllLoveBits
- {
- static void Main()
- {
- int nNum = int.Parse(Console.ReadLine());
- for (int i = 1; i <= nNum; i++)
- {
- int numP = int.Parse(Console.ReadLine());
- int numPmagic = 0;
- while (numP > 0)
- {
- numPmagic <<= 1;
- if ((numP & 1) == 1)
- {
- numPmagic|= 1;
- }
- numP >>= 1;
- }
- Console.WriteLine(numPmagic);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment