Binary to Decimal


Submit solution


Points:100 (partial)
Time limit:0.5s
Memory limit:32M
Author:

Tags
Loops, Numeral Systems
Difficulty
Easy

Using loops write a program that converts a binary integer number to its decimal form.

  • The input is entered as string. The output should be a variable of type long.
  • _Do not use the built-in .NET functionality._

Input

  • You will receive exactly one line containing an integer number representation in binary

Output

  • On the only output line write the decimal representation of the number

Constraints

  • All input numbers will be valid 32-bit integers
  • Time limit: 0.1s
  • Memory limit: 16MB

Sample tests

Input Output
0 0
11 3
1010101010101011 43691
1110000110000101100101000000 236476736

Comments