ACM一道题关于字母对应数字的情况数的
Description
AliceandBobneedtosendsecretmessagestoeachotherandarediscussingwaystoencodetheirmessages:Alice:"Let'sjustuseaverysimplecode:We'llassign`A'thecodeword1,`B'willbe2,andsoondownto`Z'beingassigned26."Bob:"That'sastupidcode,Alice.SupposeIsendyoutheword`BEAN'encodedas25114.Youcoulddecodethatinmanydifferentways!"Alice:"Sureyoucould,butwhatwordswouldyouget?Otherthan`BEAN',you'dget`BEAAD',`YAAD',`YAN',`YKD'and`BEKD'.Ithinkyouwouldbeabletofigureoutthecorrectdecoding.Andwhywouldyousendmetheword`BEAN'anyway?"Bob:"OK,maybethat'sabadexample,butIbetyouthatifyougotastringoflength500therewouldbetonsofdifferentdecodingsandwiththatmanyyouwouldfindatleasttwodifferentonesthatwouldmakesense."Alice:"Howmanydifferentdecodings?"Bob:"Jillions!"Forsomereason,AliceisstillunconvincedbyBob'sargument,sosherequiresaprogramthatwilldeterminehowmanydecodingstherecanbeforagivenstringusinghercode.
Input
Inputwillconsistofmultipleinputsets.Eachsetwillconsistofasinglelineofdigitsrepresentingavalidencryption(forexample,nolinewillbeginwitha0).Therewillbenospacesbetweenthedigits.Aninputlineof`0'willterminatetheinputandshouldnotbeprocessed
Output
ForeachinputSampleInput
Copytoclipboard
25114
1111111111
3333333333
SampleOutput
6
89
1
能否提供更多的测试用例给我?
更多的测试用例,