Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FighterAttack
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- string str = "";
- for (int i = 0; i < N; i++)
- {
- int P = int.Parse(Console.ReadLine());
- while (P > 0)
- {
- if ((P & 1) != 0)
- {
- str += '1';
- }
- else
- {
- str += '0';
- }
- P >>= 1;
- }
- Console.WriteLine(Convert.ToInt32(str, 2));
- str = "";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment