#C7310. Binary to Decimal Conversion
Binary to Decimal Conversion
Binary to Decimal Conversion
Given a string representing a binary number, convert it to its decimal equivalent.
Recall that a binary number (base-2), denoted as \(b_{n-1}b_{n-2}\ldots b_0\), can be converted to its decimal value \(D\) using the formula:
\(D = \sum_{i=0}^{n-1} b_i \times 2^{n-1-i}\)
Your task is to implement this conversion.
inputFormat
The input consists of a single line containing a binary string \(S\) composed only of characters '0' and '1'.
outputFormat
Output a single line, the decimal (base-10) integer corresponding to the binary string provided.
## sample1011
11
</p>