#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. represents in binary, and the corresponding decimal number should be instead of . 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 , and output its corresponding decimal number.
Input format
Enter a five bit binary number that may contain the leading .
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 , ensure that the input consists of five characters, each character being one of '0' or '1'.
-Subtask 1 (30 points): Ensure input is -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.