Advertisement
jokerbg

Ones&Zeros

Jan 27th, 2015
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. class OneAndZeroes
  3. {
  4.     static void Main()
  5.     {
  6.         uint numberN = uint.Parse(Console.ReadLine());
  7.         string[] one = { ".#.", "##.", ".#.", ".#.", "###" };
  8.         string[] zero = { "###", "#.#", "#.#", "#.#", "###" };
  9.  
  10.         for (int j = 0; j < 5; j++)
  11.         {
  12.             for (int i = 15; i >= 0; i--)
  13.             {
  14.                 Console.Write(((numberN >> i) & 1U) == 0 ? zero[j] : one[j]);
  15.                 Console.Write((i > 0) ? "." : "\n");
  16.             }
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement