Advertisement
KostaDinkov

C# Exam - Problem Sheets

Mar 29th, 2014
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System;
  2. class Sheets
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         string inputInBinary = Convert.ToString(int.Parse(Console.ReadLine()), 2).PadLeft(11, '0');
  7.         for (int i = 0; i < inputInBinary.Length; i++)
  8.         {
  9.             if (inputInBinary[i] == '0')
  10.             {
  11.                 Console.WriteLine("A"+i);
  12.             }
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement