#A0580. 粗心的 33DAI

粗心的 33DAI

Topic Background

33DAI created a poster for CSP-J sixteen consecutive tests and posted it on their social media.

The clever Kitten immediately noticed an error in the poster. (1000)2(1000) _2 represents 10001000 in binary, and the corresponding decimal number should be 88 instead of 1616 . 33DAI thought for a moment and kept this error on his social media to see if anyone would notice it.

As of the start time of this grammar week competition, these people have pointed out an error to 33DAI: {kitten}.

Title Description

Enter a five digit binary number that may have a leading 00 , and output its corresponding decimal number.

Input format

Enter a five bit binary number that may contain the leading 00 .

Output format

Output its corresponding decimal number.

ten thousand
sixteen
01000
eight
ten thousand one hundred and one
twenty-one
00000
0

Data scale and agreement

For data of 100%100 \% , ensure that the input consists of five characters, each character being one of '0' or '1'.

-Subtask 1 (30 points): Ensure input is 1101011010 -Subtask 2 (30 points): Ensure that only one of the five characters entered is' 1 '` -Subtask 3 (40 points): No special restrictions

Regarding base conversion:oiwiki: 二进制/八进制/十六进制转十进制

Obviously, this is a simple question for many later stage students, but as the first question in the grammar weekly competition, loops, arrays, and strings are all beyond the scope of the topic. You can think of how to complete this problem within the constraints of the syllabus.