#910. 斯诺登的密码
斯诺登的密码
说明
给定一个句子,句子由6个单词组成,以 . 结尾,即密码。
破译密码的步骤如下:
(1)找出句子中所有用英文表示的数字 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mo>≤</mo><mn>20</mn><mo stretchy="false">)</mo></mrow></semantics></math>(≤20),列举在下:
正规:one two three four five six seven eight nine ten eleven twelve
thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty
非正规:a both another first second third
。为避免造成歧义,another
算作 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow></semantics></math>1 处理。
(2)将这些数字平方后对 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>100</mn></mrow></semantics></math>100 取模,如 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>00</mn><mo separator="true">,</mo><mn>05</mn><mo separator="true">,</mo><mn>11</mn><mo separator="true">,</mo><mn>19</mn><mo separator="true">,</mo><mn>86</mn><mo separator="true">,</mo><mn>99</mn></mrow></semantics></math>00,05,11,19,86,99。
(3)把这些两位数按数位排成一行,组成一个新数,如果开头为 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow></semantics></math>0,就去 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow></semantics></math>0。
(4)找出所有排列方法中最小的一个数,即为密码。
输入格式
一个含有 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>6</mn></mrow></semantics></math>6 个单词的句子。
输出格式
一个整型变量(密码)。如果没有符合要求的数字出现,则输出 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow></semantics></math>0
样例
Black Obama is two five zero.
425