Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Task03OnesAndZeros
- {
- using System;
- class Program
- {
- static void Main()
- {
- int number = int.Parse(Console.ReadLine());
- string[,] matrix = new string[5, 2]
- {
- {"###",".#."},
- {"#.#","##."},
- {"#.#",".#."},
- {"#.#",".#."},
- {"###","###"},
- };
- for (int row = 0; row < 5; row++)
- {
- for (int pos = 15; pos >= 0; pos--)
- {
- int bit = (number & (1 << pos)) >> pos;
- Console.Write("{0}{1}", matrix[row, bit], pos == 0 ? "" : ".");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement